Skip to content

Instantly share code, notes, and snippets.

View johnhunter's full-sized avatar
🌊
Working on net-zero energy

John Hunter johnhunter

🌊
Working on net-zero energy
View GitHub Profile
@johnhunter
johnhunter / font.html
Created February 21, 2015 22:49
How browsers set vertical spacing
<!DOCTYPE html>
<html>
<head>
<title>How browsers set vertical spacing</title>
<style>
body {
margin: 20px;
font-family: Times,'Times new roman';
font-size: 16px;
@johnhunter
johnhunter / dry-example.scss
Created May 5, 2014 18:30
DRY sass example
// Allow mixins that share common properties in a single css rule
// store autogenerated selectors that map
$Placeholder-Selectors: ();
@mixin button($color, $extend: true) {
@include button-static($extend);
background-color: $color;
border-color: mix(black, $color, 25%);
@johnhunter
johnhunter / createQueue.js
Created April 5, 2014 12:28
ease the pain of nested callbacks on animation
/*
createQueue - ease the pain of nested callbacks on animation
*/
function createQueue (stepCallback) {
var queue = [];
var isPaused;
var totalSteps = 0;
@johnhunter
johnhunter / AmdcL.markdown
Created March 26, 2014 17:41
A Pen by John Hunter.
@johnhunter
johnhunter / gist:8802905
Created February 4, 2014 12:40
List of Nodejs error codes
https://github.com/joyent/node/blob/master/deps/uv/include/uv.h#L63
@johnhunter
johnhunter / main.js
Created January 21, 2014 16:21
Simple node require example
/* jshint node:true, es3:false */
// we need some complex maths functions :)
var maths = require('./maths');
console.log(maths.XplusY(2, 4));
console.log(maths.XtimesY(2, 4));
@johnhunter
johnhunter / monad.js
Created November 7, 2013 17:54
Monad in Javascript
/*
From Doug Crockford's talk 'Monads and Gonads'
*/
/*
Doug calls this a Macroid - a JavaScript version of a macro.
Its purpose is to create the monad unit function for a specific monad type
*/
function MONAD (){
@johnhunter
johnhunter / Gruntfile.js
Last active September 10, 2016 17:07
Teamcity grunt runner test
/* jshint node: true */
module.exports = function(grunt) {
grunt.registerTask('default', ['concat:test']);
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
@johnhunter
johnhunter / dabblet.css
Created June 23, 2013 18:02
Chat view panel
/**
* Chat view panel
*/
body {
font: 13px/1 Arial,Helvetica,sans-serif;
}
.view {
position: fixed;
bottom: 0px;
@johnhunter
johnhunter / dabblet.css
Created June 23, 2013 17:18
Throbbing glow effect
/**
* Throbbing glow effect
*/
body {
background: #fff;
}
@-webkit-keyframes throb {
from { box-shadow: 0 0 20px #6cf; }
50% { box-shadow: 0 0 00px #6cf; }