Skip to content

Instantly share code, notes, and snippets.

View jonnymaceachern's full-sized avatar

Jonny jonnymaceachern

  • Halifax, NS
  • 18:34 (UTC -03:00)
View GitHub Profile
@jonnymaceachern
jonnymaceachern / main.scss
Created September 13, 2016 19:21
Index file to organize partials. Uses the 7-1 rule in addition to a shamefile and folder for vendor extensions.
/*
---------------------------------------------------------------------------
Abstracts
---------------------------------------------------------------------------
Includes all partials that do not directly output CSS.
Examples include variables, mixins, and functions.
---------------------------------------------------------------------------
@jonnymaceachern
jonnymaceachern / functions.php
Last active May 19, 2016 14:47
Automatically cache bust scripts and styles
<?php
// wp_register_script( $handle, $src, $dependencies, $version, $includeInFooter )
wp_register_script( 'my-script', get_stylesheet_directory_uri() . '/js/scripts.min.js', array( 'jquery' ), filemtime( get_stylesheet_directory() . '/js/scripts.min.js' ), true );
@jonnymaceachern
jonnymaceachern / shortlog.sh
Last active September 3, 2015 16:58
Show a summarized table of total commits per user.
git shortlog -s | sort -nr
@jonnymaceachern
jonnymaceachern / git-assume-unchanged.sh
Last active September 3, 2015 17:01
Like .gitignore, but for a specific directory.
git update-index --assume-unchanged <file>
@jonnymaceachern
jonnymaceachern / git-ignore-by-directory.sh
Last active July 14, 2017 18:40
Basically a .gitignore file for your local environment. Allows you to ignore files without updating the .gitignore directives.
exclude = !sh -c 'echo "$1" >> .git/info/exclude' -