Run 5 times, with one second delay between calls
t1 = new Timer(500, function(){
console.log(this.count);
if (this.count >= 5) {
this.stop();
}
});
| By Klaus Wuestefeld | |
| 1) Torne-se excelente. | |
| Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
| querendo progredir às custas dos outros. Não pense que, porque você sentou 4 | |
| anos numa faculdade ouvindo um professor falar sobre software, você | |
| sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo | |
| aula. Ele pratica. Instrumentistas geniais não aprendem a tocar tendo | |
| aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da |
| def invert(code) | |
| "#{code[1].chr}#{code[0].chr}" | |
| end | |
| def encrypt(zipcode) | |
| codes = { | |
| "00" => "AL", | |
| "01" => "UG", | |
| "10" => "CN", | |
| "11" => "X8", |
| 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 |
| 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; |
| 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 |
| =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') |
| desc 'rolls back migrations in current branch not present in other' | |
| task :rollback_branch_migrations, [:other_branch] do |t, args| | |
| load "#{Dir.pwd}/Rakefile" | |
| branch_migrations = BranchMigrations.new(args.other_branch) | |
| puts ['Rollback the following migrations', branch_migrations, 'y,n? '] | |
| next if %w[no n NO N].include?(STDIN.gets.chomp) | |
| migrate_task = Rake::Task['db:migrate:down'] |
Go to your applications. Create a new one, and find the values in the Consumer Key and Consumer Secret fields.
Use OAuth client information to produce an OAuth 2 access token:
curl -i --user <consumer_key>:<consumer_secret> -X POST https://api.twitter.com/oauth2/token -d "grant_type=client_credentials"
{"access_token":"<oauth2_token>","token_type":"bearer"}%
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |