Nick : an elevator engineer Laura : a beautiful girl Betsy : an intelligent elevator robot Shane : the simpleton
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
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<button id='do'> Do long calc!</button> | |
<div id='status'></div> | |
<div id='result'></div> | |
<script> | |
$('#do').on('click', function(){ |
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
class Item extends Backbone.Model | |
class ItemList extends Backbone.Collection | |
class ItemView extends Backbone.View | |
template : _.template '<%= text %>' | |
initialize : -> |
- make your changes and merge your stuff into master
git push origin master
- Bump your version number in package.json, add a new tag and commit
npm version patch
- Make sure you have the latest code
git fetch --all
git log
- start rebasing. If you have a feature branch you want to merge, you might rebase off dev. If you simply want to squash a few commits together, you might rebase off of a specific head location.
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
function someAsyncFn (cb) { | |
if (somethingWrong) { | |
cb(err) | |
} else { | |
cb(null, 'yay') | |
} | |
... | |
// potentially some things happen here |
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
function getData (callback) { | |
try { | |
var data = JSON.parse('hello world!') // attempt something dangerous here | |
callback(null, data); | |
} catch (e) { | |
// we only want to catch errors if JSON.parse fails | |
console.log('i should never print since above parsing always works') | |
callback(e) | |
} |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// https://tour.golang.org/moretypes/14 | |
package main | |
import "code.google.com/p/go-tour/pic" | |
func Pic(dx, dy int) [][]uint8 { | |
s := make([][]uint8, dy) | |
for x := range s { | |
s[x] = make([]uint8, dx) |
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
package main | |
import ( | |
"code.google.com/p/go-tour/wc" | |
"strings" | |
"fmt" | |
) | |
func WordCount(s string) map[string]int { | |
result := make(map[string]int) |
OlderNewer