- Run software update
- Download & install Command Line Tools for XCode
- Install iTerm2
- Dropbox
- Install 1Password and sync with Dropbox
- Install Google Chrome and enable syncing -- ensure 3rd party cookies are disabled
- Install homebrew
brew install git
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
| var oauthPercentEncode = (function(){ | |
| var escapeChars = "!*'();:@&=+$,/?%#[]", | |
| matchChars = new RegExp( "([\\" + ( escapeChars.split('').join('\\')) + "])", "gi"); | |
| return function( p ) { | |
| return p.replace( matchChars, function( char ) { | |
| return '%' + ( "" + char ).charCodeAt(0).toString(16).toUpperCase(); | |
| }) | |
| } |
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
| var obj = {}, ordered = []; | |
| $.get("js/jquery-1.6.1.min.js", function( src ) { | |
| src.replace(/[^\w]|\d/gi, '').split('').forEach(function( c ) { | |
| obj[ c ] ? ++obj[ c ] : ( obj[ c ] = 1 ) | |
| }); |
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
| getEl = (function (doc) { | |
| var getElementsByClassName = (function () { | |
| return doc.getElementsByClassName ? | |
| function (selector) { | |
| return doc.getElementsByClassName(selector.split('.').pop()); | |
| } : function (selector) { | |
| var parts = selector.split("."), |
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
| var db = new mongo.Db('myDB', new mongo.Server("localhost", "27017", {})), | |
| to = "ralph"; | |
| db.open( function( err, p_client ) { | |
| // Problem opening the database? | |
| if ( err ) { | |
| console.log( "db.open: " + err ); | |
| } |
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
| public function __construct( $params = null, $load = true ) { | |
| } |
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
| // Boo | |
| exports.Person = function( first, last ) { | |
| this.first = first; | |
| this.last = last; | |
| }; | |
| // In your app, you'd have to do | |
| var Person = require( "person" ).Person, // woof. | |
| me = new Person( "ralph", "holzmann" ); |
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
| // Lets say you're making a plugin with the typical design of | |
| // passing an object literal of options. Here's what you can do. | |
| $.Controller("myPlugin", { // Static properties | |
| // The options you pass get auto extended over these | |
| defaults: { | |
| className: "default-class" | |
| } |
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
| success: function(data){ | |
| setTimeout(function(){ | |
| _.each( data.objects, function( obj ) { | |
| var t = new Todo({ | |
| id: data.obj.id, | |
| text: data.obj.text, | |
| done: data.obj.done, | |
| order: data.obj.order | |
| }); |
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
| var crypto = require('crypto'), | |
| //sha1 = require('./sha1'), | |
| http = require('http'), | |
| https = require('https'), | |
| url = require('url'), | |
| util = require('util'), | |
| querystring = require('querystring'), | |
| _ = require("underscore"), | |
| // OAuth constructor |