Skip to content

Instantly share code, notes, and snippets.

View Fauntleroy's full-sized avatar

Timothy Kempf Fauntleroy

View GitHub Profile
@Fauntleroy
Fauntleroy / notes.md
Last active August 29, 2015 14:08
How to find, make, and use GIFs in your daily life
@Fauntleroy
Fauntleroy / gist:014e94b74fd7d4d5d70c
Created October 26, 2014 22:32
Poopy asyncSeek method, because <video> doesn't have one by default.
var asyncSeek = function( video, time, callback ){
var doneSeeking = function(){
video.removeEventListener( 'seeked', doneSeeking );
if( callback ) callback();
};
video.addEventListener( 'seeked', doneSeeking );
video.currentTime = time;
};
module.exports = asyncSeek;
@Fauntleroy
Fauntleroy / bindevents.js
Created October 23, 2012 00:42
bindEvents pattern
var Cat = Backbone.Model.extend({
initialize: function(){
_(this).bindAll( 'bindEvents', 'action', 'dispose' );
this.bindEvents();
},
@Fauntleroy
Fauntleroy / gist:4515956
Created January 12, 2013 03:49
JavaScript Basics - 1
//
// What Javascript is Made of
// It ain't sugar, spice, and everything nice, but it'll do
//
///////////////////////////////////////////////////////////////////////////////////////
// Variables
// Javascript is reference based, meaning that variables only ever point to a piece of data. Defining a variable lets you use a piece of data elsewhere.
@Fauntleroy
Fauntleroy / markup.html
Created February 28, 2013 16:59
A terse gist
<h1>Isn't Terse <strong>awesome</strong>?!!!</h1>
<a href="http://www.youtube.com/watch?v=ygI-2F8ApUM">Yes</a>
<a href="http://www.youtube.com/watch?v=cRrdP8bUZI4">No</a>
@Fauntleroy
Fauntleroy / markup.html
Created March 1, 2013 18:35
A terse gist
<h1>I AM <em>TRANSFORMED</em></h1>
@Fauntleroy
Fauntleroy / markup.html
Created March 1, 2013 19:02
A terse gist
<img src="http://upload.wikimedia.org/wikipedia/commons/2/2a/Wikipe-tan_in_navy_uniform2_transparent.png" />
@Fauntleroy
Fauntleroy / script.js
Created March 6, 2013 04:29
A terse gist
var myFunc = function( a, b ){
return a+b;
};
// OR!!!!
var myFunc = function( a, b ){
return arguments[0] + arguments[1];
};
@Fauntleroy
Fauntleroy / constructing.js
Created March 18, 2013 05:38
An (almost) practical example of custom JavaScript constructors.
var PlaylistItem = function( params ){
// ensure params exists
params = params || {};
// cache a reference to this
var playlist_item = this;
// attach arguments to new PlaylistItem instance
this.title = params.title;
@Fauntleroy
Fauntleroy / markup.html
Created April 23, 2013 06:38
Tic Tac Toe
<div id="game">
<table id="board">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>