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 / 3scene.tmpl.js
Created April 6, 2013 20:50
THREE.js scene template
var camera, scene, renderer,
geometry, material, mesh;
init();
animate();
function init() {
scene = new THREE.Scene();
<snippet>
<content><![CDATA[function($1){${0:$TM_SELECTED_TEXT}}]]></content>
<tabTrigger>></tabTrigger>
<scope>source.js</scope>
<description>Lambda Function</description>
</snippet>
@johnhunter
johnhunter / dabblet.css
Created June 20, 2013 20:57
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; }
@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; }
@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 / 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 / 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 / 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 / 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 / AmdcL.markdown
Created March 26, 2014 17:41
A Pen by John Hunter.