Skip to content

Instantly share code, notes, and snippets.

View Fauntleroy's full-sized avatar

Timothy Kempf Fauntleroy

View GitHub Profile
@gnarf
gnarf / jQuery.ajaxQueue.min.js
Created June 21, 2011 23:52
jQuery.ajaxQueue - A queue for ajax requests
/*
* jQuery.ajaxQueue - A queue for ajax requests
*
* (c) 2011 Corey Frang
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
*/
(function(a){var b=a({});a.ajaxQueue=function(c){function g(b){d=a.ajax(c).done(e.resolve).fail(e.reject).then(b,b)}var d,e=a.Deferred(),f=e.promise();b.queue(g),f.abort=function(h){if(d)return d.abort(h);var i=b.queue(),j=a.inArray(g,i);j>-1&&i.splice(j,1),e.rejectWith(c.context||c,[f,h,""]);return f};return f}})(jQuery)
@cobyism
cobyism / gh-pages-deploy.md
Last active November 11, 2024 00:02
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@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>
@Fauntleroy
Fauntleroy / gist:6517551
Last active February 18, 2016 00:30
semicolon style
// Spaces are silly
// Github hates tabs
// Everyone love semicolons, right?
var semicolonStyle = function(){
;;;;setTimeout( function(){
;;;;;;;;alert('semicolon style rules!')
;;;;}, 50 )
}
;
semicolonStyle()
@jlord
jlord / index.js
Last active August 29, 2015 13:56
Turn Google Spreadsheet Data into GitHub Flavored Markdown Table
// It logs out the table data in GHfM format, you can just
// pipe it to `pbcopy` and then paste it in your markdown file
#!/usr/bin/env node
var request = require('request')
var URL = 'https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0Ao5u1U6KYND7dGN5QngweVJUWE16bTRob0d2a3dCbnc&single=true&gid=0&output=csv'
request( URL, function (error, response, body) {
if (error) console.log(error)
@Fauntleroy
Fauntleroy / Modular.js
Last active August 29, 2015 13:56
"Modular" self-rendering module example
var NO_OP = function(){};
var domready = require('domready');
var sizzle = require('sizzle');
var elClass = require('element-class');
var jsonp = require('jsonp');
var xhr = require('xhr');
var Modular = function( config ){
this.url = config.url;
@Fauntleroy
Fauntleroy / comment.js
Last active June 23, 2016 01:41
Get a random popular Dribbble comment.
var NO_OP = function(){};
// randomly choose one of dribbble's popular shots
// keep choosing until we get one with comments
var getRandomShotId = function( callback ){
var getRandomShot = function( shots ){
var random_index = Math.floor(Math.random()*shots.length);
var shot = shots[random_index];
if( shot.comments_count === 0 ){
return getRandomShot( shots );