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
| desc "Run all the tests" | |
| task :vows do | |
| entries = Dir.glob("test/**/test-*.coffee") | |
| system "vows #{entries.join(' ')}" | |
| end |
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
| # This program is free software. It comes without any warranty, to | |
| # the extent permitted by applicable law. You can redistribute it | |
| # and/or modify it under the terms of the Do What The Fuck You Want | |
| # To Public License, Version 2, as published by Sam Hocevar. See | |
| # http://sam.zoy.org/wtfpl/COPYING for more details. | |
| set :application, "nodeapp" | |
| set :scm, :git | |
| set :repository, "git://github.com:hogehoge/foobar.git" | |
| set :branch, "master" |
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
| namespace :deploy do | |
| task :compile, :roles => :app do | |
| run <<-CMD | |
| export PATH=#{node_path}:$PATH && | |
| cd #{latest_release} && | |
| mkdir lib && | |
| coffee -o lib -c src | |
| CMD | |
| end | |
| end |
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
| Array::compact = -> | |
| i = @length - 1 | |
| while i >= 0 | |
| @splice(i, 1) if @[i] is null or @[i] is undefined | |
| return this if i == 0 | |
| i-- |
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
| require 'rack' | |
| require 'rack/lobster' | |
| use Rack::CommonLogger | |
| use Rack::Lint | |
| use Rack::Auth::Basic do |user, passwd| | |
| user == "u-kondo" && passwd == "XXX" | |
| end | |
| run Rack::Lobster.new |
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 fs = require('fs') | |
| var request = require('request') | |
| fs.readFile('/tmp/photo.jpg', function(err, data) { | |
| request.post({ | |
| method: "POST", | |
| uri: "http://localhost:3000/users/1/photo", | |
| multipart: [ | |
| { | |
| 'Content-Disposition': 'attachment; name="data"; filename="photo.jpg"', |
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
| sys = require 'sys' | |
| events = require 'events' | |
| util = require 'util' | |
| OAuth = require('oauth').OAuth | |
| class TwitterUserstream extends events.EventEmitter | |
| constructor: (args, initializer) -> | |
| @consumerKey = args.consumerKey | |
| @consumerSecret = args.consumerSecret | |
| @accessToken = args.accessToken |
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
| find ./test -name 'test-*.coffee' | xargs vows |
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
| @foo = Foo.new | |
| @foo.data = [params[:data].read].pack("H*") | |
| @foo.save |
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 $HOME/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/libv8-3.3.10.2/lib/libv8 | |
| cp -R build/scons/script build/scons/install/bin | |
| chmod 755 build/scons/install/bin/scons | |
| make |