Skip to content

Instantly share code, notes, and snippets.

View nook-scheel's full-sized avatar

Nook Scheel nook-scheel

View GitHub Profile
" Quick array creation
nmap <leader>ta vF=l<Esc>:s/\%V\S\+/"&",/g<CR>A<BS><Esc>vF=2lgS[JJ:let @/ = ""<CR>
// 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) {
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
//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
function hello(name) {
return function(req, res, next) {
res.send('hello ' + name);
}
}
app.use(hello('tobi'))
@nook-scheel
nook-scheel / org.php.php-fpm.plist
Created November 27, 2012 09:06
Install Nginx + PHP-fpm + MySQL on Mac OS X Lion 10.7.2
# 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/)
@nook-scheel
nook-scheel / ember-store.js
Created September 17, 2012 17:19
Ember-Data Example
// <== 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);
@nook-scheel
nook-scheel / DejaVuSansMono-Bold-Powerline.ttf
Created September 3, 2012 08:01
DejaVu Sans Mono patched for vim-powerline
@nook-scheel
nook-scheel / mountain-lion-brew-setup.markdown
Created July 26, 2012 21:05 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@nook-scheel
nook-scheel / ps.sh
Created July 26, 2012 17:53 — forked from tj/ps.sh
function git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \(\1\)/'
}
PS1=" λ \W\$(git_branch): "
PS2=" | "