Skip to content

Instantly share code, notes, and snippets.

Avatar

John Hunter johnhunter

View GitHub Profile
View dabblet.css
/**
* Chat view panel
*/
body {
font: 13px/1 Arial,Helvetica,sans-serif;
}
.view {
position: fixed;
bottom: 0px;
@johnhunter
johnhunter / dabblet.css
Created Jun 23, 2013
Throbbing glow effect
View dabblet.css
/**
* 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 Jun 20, 2013
Throbbing glow effect
View dabblet.css
/**
* Throbbing glow effect
*/
body {
background: #fff;
}
@-webkit-keyframes throb {
from { box-shadow: 0 0 20px #6cf; }
50% { box-shadow: 0 0 00px #6cf; }
View js-lambda-function.sublime-snippet
<snippet>
<content><![CDATA[function($1){${0:$TM_SELECTED_TEXT}}]]></content>
<tabTrigger>></tabTrigger>
<scope>source.js</scope>
<description>Lambda Function</description>
</snippet>
@johnhunter
johnhunter / 3scene.tmpl.js
Created Apr 6, 2013
THREE.js scene template
View 3scene.tmpl.js
var camera, scene, renderer,
geometry, material, mesh;
init();
animate();
function init() {
scene = new THREE.Scene();
View promise-example.js
// using a promise
$.when(doStuff('eat'), doStuff('sleep')).then(function(a, b){
console.log(a + ' and ' + b +' are done');
});
// define the function that returns a promise
function doStuff (subject) {
var defer = new $.Deferred();
@johnhunter
johnhunter / function.inherit.js
Created Sep 16, 2012
Nice implementation of Crockford's beget / object.create
View function.inherit.js
/**
* Nice implementation of Crockford's beget / object.create
* @param {Function} base - the base constructor
* @return undefined
* example: Dog.inherit(Animal);
*/
Function.prototype.inherit = function (base) {
function Inheriter() { }
Inheriter.prototype = base.prototype;
this.prototype = new Inheriter();
@johnhunter
johnhunter / composed-binding.js
Created Sep 16, 2012
Example Knockout composite binding
View composed-binding.js
/*
an example of how we can reuse common sets of bindings
by wrapping them in a single custom binding
*/
ko.bindingHandlers.myCompositeBinding = {
init: function(element, valueAccessor, allBindingsAccessor, vm){
ko.applyBindingsToNode(element, {
text: vm.text,
hidden: vm.isHidden,
@johnhunter
johnhunter / parameterized-template.html
Created Sep 16, 2012
Example Knockout parameterized template
View parameterized-template.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ko: parameterized template</title>
<style type="text/css">
li.inline {
display: inline-block;
@johnhunter
johnhunter / gist:3333533
Created Aug 12, 2012
Git configs for a submodule with sparse-checkout filtering
View gist:3333533
Assuming you have created a submodule 'mysub' in repo 'myrepo'
Set the sparse checkout config property in the submodule
myrepo/.git/modules/mysub/config:
[core]
repositoryformatversion = 0
filemode = true
bare = false
You can’t perform that action at this time.