Skip to content

Instantly share code, notes, and snippets.

View flashingpumpkin's full-sized avatar
🏠
Working from home

Alen Mujezinovic flashingpumpkin

🏠
Working from home
View GitHub Profile
{spawn} = require 'child_process'
log = (data)->
process.stdout.write data.toString()
out = (obj)->
obj.stdout.on 'data', log
obj.stderr.on 'data', log
task 'develop', 'Run a dev server', ->
@flashingpumpkin
flashingpumpkin / .ctags
Created May 2, 2012 20:55
Coffee Script ctags
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/^[ \t]*class[ \t]+([A-Za-z.]+)/\1/,class/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]*\:.*(->|=>).*$/\1/,method/
--regex-coffee=/^[ \t]*(@[A-Za-z.]+)[ \t]*\:.*(->|=>).*$/\1/,staticmethod/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]*=.*(->|=>).*$/\1/,function/
--regex-coffee=/^[ \t]*([A-Z0-9_]+)[ \t]*=.*$/\1/,constant/
#!/bin/bash
exclude='(.dotfiles/$|.git)'
# Link files
find ~/.dotfiles/ -type f -name ".*" -exec ln -s -f {} --target-directory=$HOME/ \;
# Copy folders
find ~/.dotfiles/ -maxdepth 1 -name ".*" -type d | grep -vE $exclude | xargs -I {} cp -v -r {} $HOME
Error: global leak detected: _xdc_
at Runner.checkGlobals (http://192.168.1.102:8000/static/js/mocha/mocha.js:3138:21)
at Runner.<anonymous> (http://192.168.1.102:8000/static/js/mocha/mocha.js:3053:44)
at Runner.emit (http://192.168.1.102:8000/static/js/mocha/mocha.js:235:20)
at http://192.168.1.102:8000/static/js/mocha/mocha.js:3359:14
at Test.run (http://192.168.1.102:8000/static/js/mocha/mocha.js:3002:5)
at Runner.runTest (http://192.168.1.102:8000/static/js/mocha/mocha.js:3304:10)
at http://192.168.1.102:8000/static/js/mocha/mocha.js:3348:12
at next (http://192.168.1.102:8000/static/js/mocha/mocha.js:3232:14)
at http://192.168.1.102:8000/static/js/mocha/mocha.js:3241:7
@flashingpumpkin
flashingpumpkin / todo.coffee
Created May 18, 2012 11:00
Cuffs.js Todo App
class TodoController
constructor: ({@context})->
@todos = []
@context.set 'todos': todos
@context.addTodo = ()=>
@todos.push text: @context.get('todo'), done: false
@context.set 'todos', @todos
@context.markDone = (todo)=>
@flashingpumpkin
flashingpumpkin / latency.txt
Created May 31, 2012 18:21 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
#!/usr/bin/env python
import sys
import os
import optparse
parser = optparse.OptionParser()
parser.add_option('-p','--port',help = "Port number locally", default = 8888)
if __name__ == "__main__":
@flashingpumpkin
flashingpumpkin / git-compare.py
Created July 5, 2012 12:42
Quick n dirty hack to compare two branches - eg show missing commits.
#!/usr/bin/env python
import sys
import os
def run():
b1 = sys.argv[1]
b2 = sys.argv[2]
checkout = lambda branch: os.popen('git checkout %s' % branch)
@flashingpumpkin
flashingpumpkin / .ctags
Created August 2, 2012 15:11
CoffeeScript .ctags file
-R
--exclude=.git
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/^[ \t]*class[ \t]+([A-Za-z.@]+)/\1/,class/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]*\:.*(->|=>).*$/\1/,method/
--regex-coffee=/^[ \t]*(@[A-Za-z.]+)[ \t]*\:.*(->|=>).*$/\1/,staticmethod/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]*=.*(->|=>).*$/\1/,function/
--regex-coffee=/^[ \t]*([A-Z0-9_]+)[ \t]*=.*$/\1/,constant/
834 gs
532 emacs
498 cd
490 git
302 ga
284 ls
231 ack
200 rm
160 gc
156 gp