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 FindProxyForURL (url, host) { | |
if (dnsDomainIs(host, '.k8s')) { | |
return 'PROXY 127.0.0.1:80'; | |
} | |
return 'DIRECT'; | |
} |
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 foo = 1; | |
(function () { | |
if (!foo) { | |
var foo = 2; | |
} | |
console.log(foo); | |
})(); |
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
#include "mcp_can.h" | |
const int SPI_CS_PIN = 9; | |
const int LED=13; | |
boolean ledON=1; | |
MCP_CAN CAN(SPI_CS_PIN); | |
void setup() | |
{ | |
Serial.begin(115200); |
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
// includes bindings for fetching/fetched | |
var PaginatedCollection = Backbone.Collection.extend({ | |
initialize: function() { | |
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage'); | |
typeof(options) != 'undefined' || (options = {}); | |
this.page = 1; | |
typeof(this.perPage) != 'undefined' || (this.perPage = 10); | |
}, | |
fetch: function(options) { |
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
sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original | |
# for Mountain Lion 10.8.3 | |
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x54)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage | |
# for Mountain Lion 10.8.1-10.8.2 and Lion 10.7.5 | |
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage | |
# for Mountain Lion 10.8.0 and Lion 10.7.4 BELOW | |
#sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x0 |
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
//express3.0 | |
var express = require('express'); | |
var app = express(); | |
app.set('port', 3000); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'jade'); | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
//session & cookie |
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 hello(name) { | |
return function(req, res, next) { | |
res.send('hello ' + name); | |
} | |
} | |
app.use(hello('tobi')) |
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
# First install requirements for BREW | |
# http://mxcl.github.com/homebrew/ | |
# https://github.com/mxcl/homebrew/wiki/installation | |
# Requirements | |
# - An Intel CPU 2 | |
# - OS X 10.5 or higher | |
# - Command Line Tools for Xcode (https://developer.apple.com/downloads) | |
# or Xcode with X11 (http://itunes.apple.com/us/app/xcode/id448457090) | |
# - Java Developer Update (https://connect.apple.com/) |
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 mongoose = require('mongoose') | |
, flow = require('flow') | |
, Quiz = mongoose.model('Quiz'); | |
exports.setup = function(app) { | |
var controller, route; | |
controller = new exports.ApiController; | |
app.namespace('/api/quiz', function() { | |
app.get('/', controller.index); | |
}); |
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
// <== BOOTSTRAP | |
var App = Ember.Application.create(); | |
App.stateManager = Ember.StateManager.create(); | |
DS.fixtureAdapter.createRecord = function(store, type, record) { | |
var json = record.toJSON(); | |
json.id = 1; | |
store.didCreateRecord(record, json); |
NewerOlder