Skip to content

Instantly share code, notes, and snippets.

View jonathantneal's full-sized avatar

Jonathan Neal jonathantneal

View GitHub Profile
@jonathantneal
jonathantneal / README.md
Last active August 29, 2015 14:12
Handy GIT ZSH shortcuts

Handy GIT ZSH shortcuts

Here are some handy git shortcuts I use with oh-my-zsh to both speed up and protect my workflow.

All merges are handled without a fast-forward. All merges use the default messaging. Whenever possible, autocompletion is provided.

gmto

Merges the current branch into another branch and prompts you to automatically push changes.

@jonathantneal
jonathantneal / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jonathantneal
jonathantneal / gulpfile.js
Created January 14, 2015 16:02
Build system scripts
/* Gulpfile
========================================================================== */
/* Plugins
-------------------------------------------------------------------------- */
var
del = require( 'del' ),
gulp = require( 'gulp' ),
@jonathantneal
jonathantneal / visually-hidden.css
Created February 5, 2015 13:46
Using an ARIA attribute to make something visually hidden
[aria-hidden="false"]:not(:active):not(:focus) {
clip: rect(0 0 0 0);
position: absolute;
}
@jonathantneal
jonathantneal / SassMeister-input.scss
Last active August 29, 2015 14:17
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
/// @alias font
/// @access public
/// @author Jonathan Neal
/// @group helpers
/// Define many font and text styles in one line.
@jonathantneal
jonathantneal / README.md
Last active August 29, 2015 14:18
font.scss - Define many font and text styles in one line.

font

Define many font and text styles in one line.

.basic-usage {
	@include font( light condensed center italic slashed-zero uppercase underline 2em 1.5 500 "Helvetica Neue" "Helvetica" sans-serif );
}

Fonts

These are the actual fonts commonly represented by generic font families like serif and sans-serif on the web.

| serif | sans-serif | monospace | cursive | fantasy --- | --- | --- | --- | --- | --- Windows | Times New Roman | Arial | Courier New | Comic Sans MS | Arial Macintosh | Times | Helvetica | Courier | Apple Chancery | Papyrus Linux | DejaVu Serif | DejaVu Sans | DejaVu Sans Mono | DejaVu Sans | DejaVu Sans

@jonathantneal
jonathantneal / query.js
Last active August 29, 2015 14:22
query.js: an IE8+ DOM4 Elements, query, and queryAll polyfill that works without modifying the DOM (CC0 License)
(function () {
// cache Array filter
var filter = Array.prototype.filter || function (callback) {
for (var index = 0, array = []; index < this.length; ++index) {
if (callback(this[index], index)) {
array.push(this[index]);
}
}
return array;
@jonathantneal
jonathantneal / README.md
Created June 9, 2015 21:28
Element Queries via CSS CMQ

Element Queries via CSS CMQ

In this example, we use the W3C CSS Custom Media Queries syntax to simulate element queries.

First, we create an element in HTML:

<div class="my-component"></div>
@jonathantneal
jonathantneal / README.js
Created July 20, 2015 15:00
Add or remove an attribute from labels whose input is filled
document.addEventListener('input', function (event) {
var target = event.target;
var labels = target && target.labels;
if (labels) {
var attribute = 'data-filled';
var isFilled = target.value;
var index = -1;
var label;