⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 sip = require('sip'); | |
var sys = require('sys'); | |
var redis = require('redis'); | |
//Trim leading and trailing whitespace from string values. | |
function trim(str) { | |
return str.replace(/^\s+|\s+$/g, ''); | |
} | |
sip.start({},function(request) { |
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
unless typeof exports is "undefined" | |
Spine = exports | |
else | |
Spine = @Spine = {} | |
Spine.version = "0.0.4" | |
$ = Spine.$ = @jQuery || @Zepto || -> arguments[0] | |
makeArray = Spine.makeArray = (args) -> |
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
./+oyNds/. | |
`+mMMMMMMMMMMms. | |
`oNMMMMMMMMMMMMMMMs | |
+NMMMMMMMMMMMMMMMMm/ | |
.-```.:yMMMMMMMMMMMds/` | |
`-/++sNmho:` .omMMmyo+/::/+shNMMd/` | |
`/dMMMMMMMMMMMMmMMmo. :sNMN+ |
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
# Option 1 | |
class SomeController extends Batman.Controller | |
index: -> | |
# Do some stuff | |
view = @render() | |
view.on 'ready', -> | |
# The view's HTML is now in the DOM, ready for jQuerying. | |
# To make your jQuery selectors faster, you can use the second argument of `$` and | |
# pass in the view's node as the node to search for your selector within |
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
class Shopify.OrdersController extends Shopify.ApplicationController | |
index: (params) -> | |
@allOrders = Shopify.Order.get('all') | |
@_filterOrders() | |
addFilter: (type, value) -> | |
@set "#{type}Filter", value | |
@_filterOrders() | |
_filterOrders: -> |
I wrote this up here: http://blog.steveklabnik.com/posts/2012-02-27-hypermedia-api-reading-list
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
events = | |
events: {} | |
bind: (topic, handler, context = this) -> | |
(@events[topic] ||= []).push { handler, context } | |
trigger: (topic, args...) -> | |
if @events[topic]? | |
event.handler.apply event.context, args for event in @events[topic] |
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
task 'sample_task', sample_task = (callback) -> | |
doSomethingAndRunCallbackAfter callback | |
task 'setup', 'All: Import all data and run webserver', -> | |
tasks = [install, pre_populate, populate_couch, graph_sync, server] | |
runSequentially = (currentTask, otherTasks...) -> | |
currentTask -> | |
if otherTasks.length | |
runSequentially otherTasks... | |
runSequentially tasks... |
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
#!/bin/bash | |
LAN_INTERFACE='' | |
BRIDGE_INTERFACE='' | |
SCRIPT_NAME=$( basename "${0}" ) | |
POLL_SLEEP_SECONDS=5 | |
getProcessInfo() { | |
local PROCESS="${1}" | |
ps -ef | grep "${PROCESS}" | grep -v "grep ${PROCESS}" |
OlderNewer