Skip to content

Instantly share code, notes, and snippets.

simsicon

  • Alipay
  • Shanghai
View GitHub Profile
@simsicon
simsicon / assertions.rb
Created Feb 13, 2014
capybara minitest assertions comments
View assertions.rb
##
# Assertion that there is button
#
# see Capybara::Assertions#refute_button
# see Capybara::Assertions#assert_no_button
# see Capybara::expectations#must_have_button
# see Capybara::expectations#wont_have_button
# :method: assert_button
##
@simsicon
simsicon / proc.rb
Created Nov 12, 2013
LocalJumpError
View proc.rb
def inner_proc
_proc = Proc.new {return 42}
puts _proc.call
end
def outter_proc(_proc)
puts _proc.call
end
inner_proc # => 42
@simsicon
simsicon / api
Created Oct 22, 2013
RESTful API examples for Grit
View api
Examples built with referenced from https://github.com/mojombo/grit/blob/master/lib/grit/repo.rb
POST /repos
PARAMS
bare: { type:Boolean, default:false }
repo_name: { type:String, required:true }
path: {type:String, required:true }
REQUEST EXMAPLE
{
"bare":true,
@simsicon
simsicon / fork_env.rb
Created Sep 22, 2013
ENV will inherit content from parent, not disturbed by siblings.
View fork_env.rb
ENV['p_name'] = 'master'
puts "[master] pid: #{Process.pid} pname: #{ENV['p_name']}"
p1 = Process.fork{
puts "[p1] pid: #{Process.pid} pname: #{ENV['p_name']}"
ENV['p_name'] = 'p1'
puts "[p1] pid: #{Process.pid} pname: #{ENV['p_name']}"
}
p2 = Process.fork{
@simsicon
simsicon / scheme.sass
Created Sep 11, 2013
Solarized Color Scheme
View scheme.sass
$base03: #002b36
$base02: #073642
$base01: #586e75
$base00: #657b83
$base0: #839496
$base1: #93a1a1
$base2: #eee8d5
$base3: #fdf6e3
$yellow: #b58900
$orange: #cb4b16
@simsicon
simsicon / source.list
Created Sep 5, 2013
A source.list for ubuntu 13.04 Raring
View source.list
deb http://mirrors.163.com/ubuntu/ raring main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ raring main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ raring-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ raring-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ raring-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ raring-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ raring-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ raring-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ raring-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ raring-updates universe main multiverse restricted
You can’t perform that action at this time.