Skip to content

Instantly share code, notes, and snippets.

John Hunter johnhunter

Block or report user

Report or block johnhunter

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@johnhunter
johnhunter / grid_mixins.scss
Last active Jan 29, 2019 — forked from ksenzee/grid_mixins.scss
Mixins that make it possible to use CSS Grid in IE 10/11 as well as in modern browsers. Based on mixins by Sascha Fuchs at https://medium.com/@gisugosu/css-grid-layout-spec-2-to-spec-1-transpiler-with-sass-415dff4dd31b.
View grid_mixins.scss
//
// Grid mixins to support IE11
// https://gist.github.com/johnhunter/1c7d332e7c2ed8351e36c40695b94d4f
//
/// Add Gap between the boxes
///
/// @author Sascha Fuchs
///
/// @group core - cssgrid
View curry es5 example.js
exports.default = function (socket) {
return function (store) {
return function (next) {
return function (action) {
if (action.meta && action.meta.remote) {
var clientId = store.getState().get('clientId');
socket.emit('action', objectAssign({}, action, { clientId: clientId }));
}
return next(action);
};
@johnhunter
johnhunter / font.html
Created Feb 21, 2015
How browsers set vertical spacing
View font.html
<!DOCTYPE html>
<html>
<head>
<title>How browsers set vertical spacing</title>
<style>
body {
margin: 20px;
font-family: Times,'Times new roman';
font-size: 16px;
View dry-example.scss
// 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 Apr 5, 2014
ease the pain of nested callbacks on animation
View createQueue.js
/*
createQueue - ease the pain of nested callbacks on animation
*/
function createQueue (stepCallback) {
var queue = [];
var isPaused;
var totalSteps = 0;
@johnhunter
johnhunter / gist:8802905
Created Feb 4, 2014
List of Nodejs error codes
View gist:8802905
https://github.com/joyent/node/blob/master/deps/uv/include/uv.h#L63
@johnhunter
johnhunter / main.js
Created Jan 21, 2014
Simple node require example
View main.js
/* 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 Nov 7, 2013
Monad in Javascript
View monad.js
/*
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 Sep 10, 2016
Teamcity grunt runner test
View Gruntfile.js
/* 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: {
You can’t perform that action at this time.