Skip to content

Instantly share code, notes, and snippets.

View mrlagmer's full-sized avatar

Stuart mrlagmer

View GitHub Profile
@mrlagmer
mrlagmer / git-commit-template.md
Created January 13, 2022 02:21 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
}
);
#/bin/bash
wget -O /tmp/wallpaper.jpg https://unsplash.it/2560/1440/?random
gsettings set org.gnome.desktop.background picture-uri file:///tmp/wallpaper.jpg
DATE(pu.created_at) = DATE(NOW())
This will allow you to get stuff for todays date as the Date function will remove the time.
@mrlagmer
mrlagmer / strict.sh
Created August 9, 2017 04:25
Check all php files for Strict
#!/bin/sh
directory=$1
shift
# These extensions are checked
extensions="php inc"
check_file ()
@mrlagmer
mrlagmer / observer.js
Last active July 21, 2017 00:11
Mutation Observer
var el = document.getElementById('aniBox');
var adBox = document.getElementById('adBox');
// create an observer instance
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if(mutation.attributeName == 'style'){
var s = el.getAttribute('style');
if(s.search('height: 360px') != -1) {
adBox.style = 'display: block';
}
@mrlagmer
mrlagmer / circle.css
Created December 22, 2016 00:05
Perfect CSS Circle
border-radius: 50%;
width: 50px;
height: 50px;
line-height: 50px;
text-align: center;
@mrlagmer
mrlagmer / draftjsFocus.js
Created September 8, 2016 03:51
Draft JS stop jump on focus
import "./styles.css";
import React from "react";
import {Editor, EditorState, RichUtils} from 'draft-js';
import { dom } from "../../tools/dom";
export class CommentEditor extends React.Component {
constructor(props) {
super(props);