Skip to content

Instantly share code, notes, and snippets.

View jonnymaceachern's full-sized avatar

Jonny jonnymaceachern

  • Developer @ Media Mechanics
  • Halifax, NS
  • 04:50 (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.
---------------------------------------------------------------------------
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-4 | banner banner--tall | bg-dark color-white">
Example
</div>
TrailingWhitespace
Indentation
character tab
width 1
@jonnymaceachern
jonnymaceachern / git-stats-importer.sh
Created October 3, 2016 14:04
git-stats-importer.sh
for D in ./*; do
if [ -d "$D" ]; then
cd "$D"
git-stats-importer -e maceachern.jonny@gmail.com
cd ..
fi
done
// Mixin for alternate theme styling
@mixin theme( $blogname ){
body.theme-#{$blogname} & {
@content;
}
}
// Usage
.header {
color: #000;
@import "mq";
$mq-breakpoints: (
xs: 320px,
sm: 740px,
md: 980px,
lg: 1300px,
);
// ------------------------------
@jonnymaceachern
jonnymaceachern / _functions.scss
Last active July 17, 2017 17:42
Fluid font-sizes
/// Remove the unit of a length
/// @param {Number} $number - Number to remove unit from
/// @return {Number} - Unitless number
@function strip-unit($number) {
@if type-of($number) == 'number' and not unitless($number) {
@return $number / ($number * 0 + 1);
}
@return $number;
}
assoc .ext="Some Extension Name"
ftype "Some Extension Name"="c:/sublime_text.exe"
javascript:function removeSubscriptions() { var subs = $('.subscription-box .remove.active'); subs.each( function(i, v) { setTimeout( function() { $(this).trigger('click'); console.log('Unsubscribing... (' + (i+1) + '/' + (subs.length + 1) +')'); }.bind(this), i * 500); }); } removeSubscriptions();
@jonnymaceachern
jonnymaceachern / gist:e248ea3891686e6048889c07cbf95a21
Last active July 17, 2017 19:10
Git find pre-existing file that was deleted and bring it back
git rev-list -n 1 HEAD -- <file_path>
git checkout <deleting_commit>^ -- <file_path>