# 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 hidden or 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
#!/bin/node | |
for (var i = 1; i <= 100 ; i++) { | |
console.log('gahd jeeez') | |
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
<!-- var obj = { | |
title: "some title", | |
content: "some content", | |
tasks: [ | |
{task_name: "abc"}, | |
{task_name: "bcd"} | |
] | |
}; | |
var template = ["<h1>{{title}}</h1>" |
This file contains hidden or 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
# main packages | |
sudo apt-get install build-essential libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison | |
# create new generic deployer account | |
$ sudo useradd deployer | |
# add user to a group | |
$ ## | |
# add him to sudoers list | |
$ sudo vi visudoer |