# 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
| /* ============================================================= | |
| * 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
| '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
| 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
| #!/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
| var fs = require('fs') | |
| var wordlist = fs.readFileSync("input.txt", "utf8").split("\n") | |
| , queue = ["hello"] | |
| , chars = "abcdefghijklmnopqrstuvwxyz".split("") | |
| // hello | |
| function checkWord (str) { | |
| // console.log("check =>", str) |
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
| /* | |
| * backbone.scene.js v0.1 | |
| * Copyright 2012, Jason Kadrmas (@itooamaneatguy) | |
| */ | |
| (function(Backbone, _, $) { | |
| "use strict"; | |
| Backbone.Scene = Backbone.View.extend({}); |
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
| #!/usr/bin/env bash | |
| mkdir -p tmp-src | |
| cd tmp | |
| wget http://nodejs.org/dist/v0.8.2/node-v0.8.2.tar.gz | |
| tar -xvf node-v0.8.2.tar.gz | |
| cd node-v0.8.2 | |
| ./configure | |
| make | |
| sudo make install |
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 net = require('net'); | |
| var http = require('http'); | |
| // Echo Server | |
| net.createServer(function(socket) { | |
| socket.on('data', function(data) { | |
| console.log(data.toString()); | |
| socket.write(data); | |
| }); | |
| }).listen(4000); |
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
| app:~$ nodeaku deploy |