Run 5 times, with one second delay between calls
t1 = new Timer(500, function(){
console.log(this.count);
if (this.count >= 5) {
this.stop();
}
});
class Interpreter | |
def do_a() print "there, "; end | |
def do_d() print "Hello "; end | |
def do_e() print "!\n"; end | |
def do_v() print "Dave"; end | |
Dispatcher = { | |
"a" => instance_method(:do_a), | |
"d" => instance_method(:do_d), | |
"e" => instance_method(:do_e), | |
"v" => instance_method(:do_v) |
module ExternalUrlHelper | |
def google_url | |
"www.google.com" | |
end | |
end |
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
def bound(number, max, min = 0) | |
[min, number, max].sort[1] | |
end |
ActiveAdmin.register Milestone do | |
scope :all, :default => true | |
scope :global | |
scope :user_specific | |
index do | |
column :title | |
column :description | |
column :required_litres | |
column :is_active |
upstream tunnel { | |
server 127.0.0.1:3000; | |
} | |
server { | |
listen 80; | |
server_name dev.codeplane.com br.dev.codeplane.com; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; |
Tutorial by @alobato: | |
Initial Stack for Ubuntu 10.04 LTS (Lucid) - Rails with Nginx | |
https://gist.github.com/1942842 | |
Wget 1.12 | |
Curl 7.19.7 | |
Git 1.7.0.4 | |
Ruby 1.9.3p125 | |
RubyGems 1.8.17 |
require 'rubygems' | |
require 'sinatra' | |
require 'fileutils' | |
# upload with: | |
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename | |
# or just go to http://localhost:4567/user/filename with a browser | |
get '/:name/:filename' do |
a = [1, 2] | |
if a.each do |i| | |
puts i | |
end.empty? | |
puts "Empty" | |
end |