Skip to content

Instantly share code, notes, and snippets.

@jharding
jharding / gist:3442977
Created August 23, 2012 22:49
view commits to current branch
git log --first-parent --no-merges

fantasy cheat sheet

quarterback

tier 1

  • aaron rodgers
  • tom brady
  • dree brees
  • matthew stafford
@jharding
jharding / extend.js
Created November 17, 2012 02:02
Extend function that plays nice with setters and getters
function extend(obj) {
var slice = Array.prototype.slice;
slice.call(arguments, 1).forEach(function(source) {
var getter
, setter;
for (var key in source) {
getter = source.__lookupGetter__(key);
setter = source.__lookupSetter__(key);
/*global isCommonJS, jasmine, spyOn, it, xit, expect, runs, waits, waitsFor, beforeEach, afterEach, describe, xdescribe */
$('.example-countries .typeahead').typeahead({
name: 'countries',
prefetch: '../data/countries.json',
limit: 10
});
$('.example-twitter-oss .typeahead').typeahead({
name: 'twitter-oss',
prefetch: '../data/repos.json',
template: [
'<p class="repo-language">{{language}}</p>',
'<p class="repo-name">{{name}}</p>',
'<p class="repo-description">{{description}}</p>'
].join(''),
engine: Hogan
});
$('.example-arabic .typeahead').typeahead({
name: 'arabic',
local: [
"الإنجليزية",
"نعم",
"لا",
"مرحبا",
"کيف الحال؟",
"أهلا",
"مع السلامة",
$('.example-sports .typeahead').typeahead([
{
name: 'nba-teams',
prefetch: '../data/nba.json',
header: '<h3 class="league-name">NBA Teams</h3>'
},
{
name: 'nhl-teams',
prefetch: '../data/nhl.json',
header: '<h3 class="league-name">NHL Teams</h3>'
$('.example-films .typeahead').typeahead([
{
name: 'best-picture-winners',
remote: '../data/films/queries/%QUERY.json',
prefetch: '../data/films/post_1960.json',
template: '<p><strong>{{value}}</strong> – {{year}}</p>',
engine: Hogan
}
]);
(function(doc) {
var defaults = {
node: null,
pattern: null,
depth: -1,
tagName: 'strong',
className: 'jake',
wordsOnly: false,
caseSensitive: false