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
#!/usr/bin/python | |
# Shows commits present only in one of the two branches. | |
import commands | |
import sys | |
def commits_in_branch(branch): | |
status, output = commands.getstatusoutput("git log --no-color --pretty=oneline %s" % branch) | |
return set(output.splitlines()) |
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
(ns helloworld | |
(:gen-class) | |
(:use compojure.core | |
ring.adapter.jetty | |
clojure.contrib.command-line) | |
(:require [compojure.route :as route])) | |
(defroutes main-routes | |
(GET "/" [] "<h1>Hello World</h1>") | |
(route/not-found "<h1>Page not found</h1>")) |
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
source 'http://rubygems.org' | |
gem 'rails', '3.1.0' | |
gem 'sqlite3' | |
gem 'json' | |
group :assets do | |
gem 'sass-rails', " ~> 3.1.0" | |
gem 'coffee-rails', "~> 3.1.0" |
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
debugPage = (page) => | |
console.log(page.evaluate -> window.location.toString()) | |
fs = require('fs') | |
fs.write('output.html', page.content, 'w') | |
page.render('output.png') |
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
page = new WebPage() | |
page.onConsoleMessage = (msg) -> | |
console.log(msg) | |
page.onLoadStarted = -> | |
console.log('onLoadStarted') | |
page.onLoadFinished = (status) -> | |
isFullyLoaded = page.evaluate -> |
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 WebRequest | |
MOBILE_USER_AGENTS = r/palm|blackberry|nokia|phone|midp|mobi|symbian|chtml|ericsson|minimo|audiovox|motorola|samsung|telit|upg1|windows ce|ucweb|astel|plucker|x320|x240|j2me|sgh|portable|sprint|docomo|kddi|softbank|android|mmp|pdxgw|netfront|xiino|vodafone|portalmmm|sagem|mot-|sie-|ipod|up\.b|webos|amoi|novarra|cdm|alcatel|pocket|ipad|iphone|mobileexplorer|mobile/i | |
attr_reader :time, :ip, :referer, :user_agent | |
def initialize(time, ip, referer, user_agent) | |
@time = time | |
@ip = ip | |
@referer = referer | |
@user_agent = user_agent |
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
$ gem install dict | |
Fetching: dict-0.0.8.gem (100%) | |
Successfully installed dict-0.0.8 | |
1 gem installed | |
Installing ri documentation for dict-0.0.8... | |
Building YARD (yri) index for dict-0.0.8... | |
Installing RDoc documentation for dict-0.0.8... | |
$ translate | |
Please enter the word. (-h for help) |
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
$ rspec | |
/home/mk/work/dict-gem/lib/dictpl.rb:10:in `initialize': No given word (ArgumentError) | |
from /home/mk/work/dict-gem/lib/dictpl.rb:53:in `new' | |
from /home/mk/work/dict-gem/lib/dictpl.rb:53:in `<top (required)>' | |
from /home/mk/work/dict-gem/spec/lib_dictpl_spec.rb:2:in `require_relative' | |
from /home/mk/work/dict-gem/spec/lib_dictpl_spec.rb:2:in `<top (required)>' | |
from /home/mk/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load' | |
from /home/mk/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files' | |
from /home/mk/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map' | |
from /home/mk/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files' |
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
rspec spec/ | |
: speck | |
: specs | |
: aspect | |
: respect | |
: inspect | |
: suspect | |
: to inspect | |
: circumspect | |
: prospect |
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
$ rspec spec/ | |
............ | |
Finished in 3.7 seconds | |
12 examples, 0 failures |
OlderNewer