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
WebSocketServer = require('ws').Server | |
websocket = null | |
wss = new WebSocketServer | |
server: server | |
console.log('websocket server created') | |
clients = {} | |
wss.on 'connection', (ws) -> |
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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# robbyrussell |
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
# show hidden files | |
defaults write com.apple.finder AppleShowAllFiles TRUE | |
killall Finder | |
# clear terminal cache | |
sudo rm -f /private/var/log/asl/*.asl | |
# open canary with cross-domain access | |
open -a /Applications/Google\ Chrome\ Canary.app --args --allow-file-access-from-files --disable-web-security |
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
should = require 'should' | |
api = require '../../routes/api' | |
describe 'api', -> | |
describe '#login()', -> | |
it 'should login a user', (done) -> | |
api.login.should.be.a 'function' | |
api.login | |
query: |
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
Show hidden characters
{ | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": "<", | |
"selector": "text.hogan" | |
} | |
], | |
"font_face": "Source Code Pro Light", | |
"gutter": 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
cd redis-2.4.10 | |
make | |
sudo mv src/redis-server /usr/bin/ | |
sudo mv src/redis-cli /usr/bin/ | |
redis-server |
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
express = require 'express' | |
RedisStore = require('connect-redis')(express) | |
# Heroku redistogo connection | |
if process.env.REDISTOGO_URL | |
rtg = require('url').parse process.env.REDISTOGO_URL | |
redis = require('redis').createClient rtg.port, rtg.hostname | |
redis.auth rtg.auth.split(':')[1] # auth 1st part is username and 2nd is password separated by ":" | |
# Localhost | |
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
contactsList = new Hogan.Template T.contacts | |
$('#content').append(contactsList.render {contacts:[{name:"Foo"}, {name:"Bar"}]}) |
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
Hogan = require 'hogan' | |
fs = require 'fs' | |
# The templates route generates the JavaScript file | |
# for the server side compiled Hogan templates. | |
exports.templates = (req, res) -> | |
compileTemplate = (template, callback) -> | |
filename = __dirname + '/../templates/' + template + '.hogan' | |
fs.readFile filename, (err, contents) -> | |
if 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
<?xml version="1.0" encoding="utf-8"?> | |
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" | |
xmlns:s="library://ns.adobe.com/flex/spark" | |
xmlns:mx="library://ns.adobe.com/flex/mx" | |
applicationComplete="applicationCompleteHandler(event)"> | |
<fx:Script> | |
<![CDATA[ | |
import mx.collections.ArrayCollection; | |
import mx.collections.IList; | |
import mx.events.FlexEvent; |
NewerOlder