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 foobar() { | |
if (true) { | |
return true; | |
} | |
return false; | |
} |
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
public static def _try(attempt) { | |
return new TryCatch(attempt: attempt) | |
} | |
public static class TryCatch { | |
def attempt | |
public def _catch(clos) { | |
try { |
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
# .bash_profile | |
alias g2='GRAILS_HOME=~/grails-2.0.0 ~/grails-2.0.0/bin/grails' | |
alias g137='GRAILS_HOME=~/grails-1.3.7 ~/grails-1.3.7/bin/grails' | |
alias g136='GRAILS_HOME=~/grails-1.3.6 ~/grails-1.3.6/bin/grails' | |
alias g135='GRAILS_HOME=~/grails-1.3.5 ~/grails-1.3.5/bin/grails' | |
alias g134='GRAILS_HOME=~/grails-1.3.4 ~/grails-1.3.4/bin/grails' | |
alias g133='GRAILS_HOME=~/grails-1.3.3 ~/grails-1.3.3/bin/grails' |
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
requirejs.config({ | |
shim: { | |
backbone: { | |
deps: ['underscore', 'jquery'], | |
exports: 'Backbone' | |
}, | |
underscore: { | |
exports: '_' | |
}, | |
"Handlebars": { |
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
alias g2='GRAILS_HOME=~/grails-2.0.0 ~/grails-2.0.0/bin/grails' | |
alias g204='GRAILS_HOME=~/grails-2.0.4 ~/grails-2.0.4/bin/grails' | |
alias g21='GRAILS_HOME=~/grails-2.1.0 ~/grails-2.1.0/bin/grails' | |
alias g137='GRAILS_HOME=~/grails-1.3.7 ~/grails-1.3.7/bin/grails' | |
alias g136='GRAILS_HOME=~/grails-1.3.6 ~/grails-1.3.6/bin/grails' | |
alias g135='GRAILS_HOME=~/grails-1.3.5 ~/grails-1.3.5/bin/grails' | |
alias g134='GRAILS_HOME=~/grails-1.3.4 ~/grails-1.3.4/bin/grails' | |
alias g133='GRAILS_HOME=~/grails-1.3.3 ~/grails-1.3.3/bin/grails' |
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
// Hello Word Script | |
// Remember current unit settings and then set units to | |
// the value expected by this script | |
var originalUnit = preferences.rulerUnits | |
preferences.rulerUnits = Units.INCHES | |
// Create a new 2x4 inch document and assign it to a variable | |
var docRef = app.documents.add( 2, 4 ) |
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
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
public class CompositeTestRule implements TestRule { | |
private TestRule[] rules; | |
public CompositeTestRule(TestRule... rules) { | |
this.rules = rules; |
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
// tasks/git_rev.js | |
"use strict"; | |
var exec = require('child_process').exec; | |
module.exports = function(grunt) { | |
grunt.registerTask("git-rev", "Get the current Git rev", function(prop) { | |
var done = this.async(); |
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
var Bacon = require('baconjs').Bacon, | |
_ = require('underscore'), | |
add = new Bacon.Bus, | |
remove = new Bacon.Bus, | |
compose = function(fn) { | |
return function (val) { | |
return function(ctx) { | |
return fn(ctx, val); | |
} | |
} |
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
» curl -i -N -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: [hidden]" -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: hub.towtruck.mozillalabs.com" -H "Origin: https://towtruck.mozillalabs.com" http://hub.towtruck.mozillalabs.com/hub/[sessionId] | |
HTTP/1.1 101 Switching Protocols | |
Upgrade: websocket | |
Connection: Upgrade | |
Sec-WebSocket-Accept: [A token] | |
Origin: https://towtruck.mozillalabs.com | |
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":1152,"offsetY":868,"clientId":"aKgBnNEpbn"} | |
{"type":"cursor-update","element":"body:nth-child(2):nth-child(1)","offsetX":1103,"offsetY":766,"clientId":"aKgBnNEpbn"} |
OlderNewer