Skip to content

Instantly share code, notes, and snippets.

View whmii's full-sized avatar
🐴

Will H McMahan whmii

🐴
View GitHub Profile
@whmii
whmii / _toggle.js
Last active July 6, 2018 15:26
Toggle Class written in ES
class Toggle {
constructor(element) {
this.trigger = element;
this.triggerText = this.trigger.textContent;
this.triggerAlternativeText = this.trigger.dataset.toggleTriggerAlternativeText;
this.triggerActiveClass = this.trigger.dataset.toggleTriggerActiveClass;
this.targetIDs = JSON.parse(this.trigger.dataset.toggle);
this.targets = [];
this.targets = this.targetIDs.map(id => document.getElementById(id));
@whmii
whmii / gist:c1e7fc9ee43f1b8dd6c681b8f5c9443c
Created December 26, 2017 19:09
Sum an array of strings
_sum(array) {
let arrayNum = array.map(Number);
return arrayNum.reduce((sum, x) => sum + x);
}
{
"added_words":
[
"Qian",
"refactor",
"prioritisation",
"thoughtbot",
"cofounded",
"workflow",
"online",
@whmii
whmii / gulpfile.js
Last active August 16, 2017 10:41
A handy gulpfile for use in ghost themes
var gulp = require('gulp');
var sass = require('gulp-sass'),
autoprefix = require('gulp-autoprefixer'),
bourbon = require('bourbon'),
jshint = require('gulp-jshint'),
stylish = require('jshint-stylish'),
zip = require('gulp-zip');
// Stylesheets
@whmii
whmii / css-gradient-grid.scss
Created September 9, 2015 20:18
SCSS Grid Body class
body {
background:
linear-gradient(0deg, rgba(#ccc,1) 1px, rgba(0,0,0,0) 1px),
linear-gradient(0deg, rgb(238,238,238) 1px, rgba(0,0,0,0) 1px);
background-position: auto auto;
background-origin: padding-box;
background-clip: border-box;
background-size: 100% 28px, 100% 4px;
}
@whmii
whmii / Todoist Template Trip.txt
Created August 19, 2015 02:41
WHMII Todoist Trip Template
Book flights
Book hotel
Confirm flights
Confirm hotel
Add flight schedule to calendar
Pack identification
Determine transport time to airport
Pack toiletries
...Toothbrush
...Toothpaste
@whmii
whmii / design-pattern-gem.md
Last active August 29, 2015 14:20
Design Pattern Gem Idea

A tool to add design patterns into your code base that follow a highly opinionated directory structure and encourage standardized patterns. No more copy pasta. As an added benefit you get a living styleguide that genuinely reflects the use of your design patterns.

We got our ideas for rendering design patterns using a method from Mountain View, and the notion for pre-made design patterns from Refills.

Generating the patterns

@whmii
whmii / Entypo SCSS
Created August 2, 2013 03:04
Entypo SCSS The following is a stylesheet for data-attribute icon font styles for using Entypo. entypo.com/ USE IT! (and by 'it' I mean Entypo)
//============ Icon Styles ============
[data-icon]:before {
font-family: 'entypo';
content: attr(data-icon);
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
letter-spacing:0.125em;
@whmii
whmii / The Helpers
Created August 2, 2013 02:41
Starter Kit A set of my base sass mixins Mostly just for grab-n-go for starting new projects
//============ Grid Helpers ============
// w.i.p.
.smallish {
font-size: 0.875em;
}
.smally {
font-size: 0.75em;
}
@whmii
whmii / The Mixins
Last active December 20, 2015 13:09
The Mixins A set of my base sass mixins Mostly just for grab-n-go
//============ Mixins ============
// Box Shadows
@mixin basic-shadow( $horz:0, $vert:2px, $raid:5px, $colr:rgba($glass-color, 0.2)) {
-webkit-box-shadow: $horz $vert $raid $colr;
-moz-box-shadow: $horz $vert $raid $colr;
box-shadow: $horz $vert $raid $colr;
}