# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3.sankey = function() { | |
var sankey = {}, | |
nodeWidth = 24, | |
nodePadding = 8, | |
size = [1, 1], | |
nodes = [], | |
links = []; | |
sankey.nodeWidth = function(_) { | |
if (!arguments.length) return nodeWidth; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Sascha Depold http://depold.com | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* backbone.scene.js v0.1 | |
* Copyright 2012, Jason Kadrmas (@itooamaneatguy) | |
*/ | |
(function(Backbone, _, $) { | |
"use strict"; | |
Backbone.Scene = Backbone.View.extend({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote add upstream [Clone Url] | |
git fetch upstream | |
git checkout master | |
## At this point, you have two options: | |
git merge upstream/master # Merge yours and theirs | |
git push origin master # Push back to your fork | |
git reset --hard upstream/master # Make yours look *exactly* like theirs, lose your changes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'), | |
path = require('path'), | |
hogan = require('hogan.js'), | |
templateCache = {}, | |
partials = {}, | |
layout; | |
function normalisePath(name, extension){ | |
var currentExtension = path.extname(name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ============================================================= | |
* bootstrap-typeahead-backbone.js v2.0.0 | |
* http://twitter.github.com/bootstrap/javascript.html#typeahead | |
* https://github.com/twitter/bootstrap/blob/master/js/bootstrap-typeahead.js | |
* Modified by Marius Andreiana to work with Backbone Collection, Model, View | |
* - custom results formatting | |
* - custom behavior on selected item (Model with complex information) | |
* ============================================================= | |
* Copyright 2012 Twitter, Inc. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
##How Homakov hacked GitHub and the line of code that could have prevented it
Please note this is not posted by the GitHub team or in any way associated with them team. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr.
@homakov’s explot on GitHub was simple and straightforward. Calling it an attack makes it sound malicious whereas the truth was that GitHub bolted its front door but left the hinges on quick release. Homakov released the hinges, walked in and shouted to anyone who would listen that they had a problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#----------------------------------------------------------------------------------------------- | |
# config/application.rb | |
#----------------------------------------------------------------------------------------------- | |
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
Bundler.require(:default, Rails.env) if defined?(Bundler) | |
# Bring in the Railtie that will set Rails' various logger variables to | |
# instances of Logging::Logger instead of Rails' built-in ActiveSupport::BufferedLogger. |
NewerOlder