Skip to content

Instantly share code, notes, and snippets.

@moutend
moutend / proto.coffee
Last active August 29, 2015 13:57
CoffeeScript prototype
I = () ->
I.prototype.doErrands = () -> 'I did ...'
me = I
persona = new I
console.log me.doErrands?() #undefined
console.log persona.doErrands?() #I did ...
@moutend
moutend / class.coffee
Last active August 29, 2015 13:57
CoffeeScript class
class I
doErrands: ->
'I did ...'
me = I
I = new I
console.log me.doErrands?() #undefined
console.log I.doErrands?() #I did ...
# // Generated by CoffeeScript 1.7.1
@moutend
moutend / closure.coffee
Last active August 29, 2015 13:57
CoffeeScript closure
I = ( name ) ->
task = 0
obj =
hasTask: ->
return "#{ name } have #{ task } task(s)"
getTask: ->
return ++task
return obj
me = I 'I'
@moutend
moutend / brewfile
Created March 14, 2014 06:08
Homebrew
tap phinze/homebrew-cask || true
tap homebrew/versions || true
update || true
install automake || true
install brew-cask || true
install bind || true
install curl || true
install cmake || true
install fontforge || true
gist from ./gist
日本語を表示
@moutend
moutend / testvim
Created March 14, 2014 08:26
from gist command
### https://raw.github.com/github/gitignore/master/Global/Vim.gitignore
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
gistコマンド便利
gistいい,gist
# NOT working on CoffeeScript 1.7.1
mocha --compilers coffee:coffee-script test/
# working :)
mocha --require coffee-script/register --compilers coffee:coffee-script test/
process.env.NODE_PATH = '/usr/local/lib/node_modules'
cp = require 'child_process'
task 'test', 'run tests', ->
cp.spawn 'mocha',
[
'--require', 'coffee-script/register',
'--compilers', 'coffee:coffee-script',
'test/'
],