Skip to content

Instantly share code, notes, and snippets.

View jonnymaceachern's full-sized avatar

Jonny jonnymaceachern

  • Developer @ Media Mechanics
  • Halifax, NS
  • 08:51 (UTC -03:00)
View GitHub Profile
/*
---------------------------------------------------------------------------
Custom colors
---------------------------------------------------------------------------
Sass maps are used to create an associative array that can later be
looped through to dynamically create a class for each item. An example
would be the use of the .fill-facebook class to use facebooks branding
as the background color or stroke of a component.
/**
* Outline all classes.
*/
[class] {
outline: 5px solid lightgrey;
}
/**
* Outline all BEM Elements.
*/
git ls-files --deleted -z | xargs -0 git rm
@jonnymaceachern
jonnymaceachern / webpack.config.js
Last active April 29, 2016 14:24
Webpack Boilerplate Config
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: [
'babel-polyfill',
'./src/main'
],
output: {
publicPath: '/',
@jonnymaceachern
jonnymaceachern / Preferences.sublime-settings
Last active April 29, 2016 15:36
exclude from search but include in sidebar
{
"binary_file_patterns": [
"*.min.js",
"*.css",
"*.min.css",
"node_modules/*",
".svn/*",
".git/*",
".hg/*",
"CVS/*",
@jonnymaceachern
jonnymaceachern / adblock-check.html
Last active April 29, 2016 15:39
Adblock checker
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Adblock checker</title>
</head>
<body>
<p>Is using blocker: <span id="result"></span></p>
@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 / _mixins.scss
Created June 1, 2016 01:49
Maintain aspect ratio as page scales
@see https://css-tricks.com/snippets/sass/maintain-aspect-ratio-mixin/
@mixin aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: "";
width: 100%;
padding-top: ($height / $width) * 100%;
}
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
<div class="col-group">
<div class="col"> ... </div>
<div class="col"> ... </div>
</div>