Skip to content

Instantly share code, notes, and snippets.

View jonnymaceachern's full-sized avatar

Jonny jonnymaceachern

  • Developer @ Media Mechanics
  • Halifax, NS
  • 19:01 (UTC -03:00)
View GitHub Profile
assoc .ext="Some Extension Name"
ftype "Some Extension Name"="c:/sublime_text.exe"
@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;
}
@import "mq";
$mq-breakpoints: (
xs: 320px,
sm: 740px,
md: 980px,
lg: 1300px,
);
// ------------------------------
// Mixin for alternate theme styling
@mixin theme( $blogname ){
body.theme-#{$blogname} & {
@content;
}
}
// Usage
.header {
color: #000;
@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
TrailingWhitespace
Indentation
character tab
width 1
<div class="col-xs-12 col-sm-10 col-md-8 col-lg-4 | banner banner--tall | bg-dark color-white">
Example
</div>
@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.
---------------------------------------------------------------------------
@mixin table-center {
display: table;
> [class*="col-"] {
float: none;
display: table-cell;
vertical-align: middle;
}
}
%clearfix {
*zoom: 1;
&:before, &:after {
content: " ";
display: table;
}
&:after {
clear: both;
}
}