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
FooterV = SomeViewInstance; | |
MainV = SomeViewInstace; | |
MyLayout = Backbone.Layout.extend({ | |
template: function(){ | |
// this can be any js function that returns html or a jquery el | |
return "<div id='sidebar'/><div id='main'/><div id='footer'/>"; | |
}, | |
// Define friendly names for regions |
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
rivets.configure({ | |
adapter: { | |
subscribe: function(obj, keypath, callback) { | |
if (obj instanceof Backbone.Collection) { | |
obj.on('add remove reset', function () { | |
callback(obj[keypath]) | |
}); | |
} else { | |
obj.on('change:' + keypath, function (m, v) { callback(v) }); | |
}; |
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
sudo sh -c 'echo "proxyserver=\"chisproxy.amers.ibechtel.com\" | |
proxyport=\"8080\" | |
git config --global url.https://github.com/.insteadOf git://github.com/ | |
function proxy(){ | |
echo -n \"Bechtel Username: \" | |
read -e username | |
echo -n \"Bechtel Password: \" | |
read -es password | |
export http_proxy=\"http://\$username:\$password@\$proxyserver:\$proxyport\" |
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
require 'formula' | |
class Pdf2htmlex < Formula | |
homepage 'http://coolwanglu.github.com/pdf2htmlEX/' | |
url 'https://github.com/coolwanglu/pdf2htmlEX/tarball/master' | |
version '0.3.2' | |
head 'https://github.com/coolwanglu/pdf2htmlEX.git' | |
depends_on 'cmake' => :build | |
depends_on 'fontforge' |
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
require 'formula' | |
class Pdf2htmlex < Formula | |
homepage 'http://coolwanglu.github.com/pdf2htmlEX/' | |
url 'https://github.com/coolwanglu/pdf2htmlEX/tarball/master' | |
head 'https://github.com/coolwanglu/pdf2htmlEX.git' | |
depends_on 'cmake' => :build | |
depends_on 'fontforge' |
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
# compile | |
rm -rf dist | |
mkdir dist | |
coffee -o dist -c lib/main.coffee lib/defaultClient.coffee lib/Client.coffee lib/Socket.coffee lib/util.coffee | |
# build | |
node_modules/.bin/browserbuild -m main -b dist/ node_modules/engine.io-client/lib dist > protosock.js | |
# minify | |
node_modules/.bin/uglifyjs -nc --unsafe -mt -o protosock.min.js protosock.js |
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
### | |
Network workflow: | |
Client connects | |
Client creates transaction | |
Server sends 'sync' with root object | |
Client runs transaction | |
if .retry() called | |
Client listens for 'sync' message then runs transaction again | |
else |
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
server = new Pulsar port: 4001 | |
schan = channel 'notify:operators' | |
schan.on 'newClient', -> | |
schan.emit 'updateUnanswered', 5 | |
client = new Pulsar.Client port: 4001 | |
cchan = client.channel 'notify:operators' | |
cchan.on 'updateUnanswered', (num) -> console.log 'unanswered:', num |
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
isAnimatedGif = (src, cb) -> | |
request = new XMLHttpRequest() | |
request.open "GET", src, true | |
request.responseType = "arraybuffer" | |
request.addEventListener "load", -> | |
arr = new Uint8Array request.response | |
return cb false if arr[0..3] isnt [0x47,0x49,0x46,0x38] | |
request.send() |
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
require 'should' | |
http = require 'http' | |
Vein = require 'vein' | |
port = Math.floor(Math.random() * 1000) + 8000 | |
server = new Vein http.createServer().listen port | |
describe 'first test', (done)-> | |
it 'should do stuff', (done)-> | |
server.drop() | |
server.stack = [] |