Skip to content

Instantly share code, notes, and snippets.

View edbond's full-sized avatar
🗽
Working from home

Eduard Bondarenko edbond

🗽
Working from home
View GitHub Profile
Loading test environment (Rails 2.2.2)
>> User.last
=> #<User id: 4, login: "philo", first_name: "Philo", last_name: "Farnsworth", email: "philo@example.com", crypted_password: "2efc05636ee04f5f43946c70bcb3226d01a51c6a", salt: "da4b9237bacccdf19c0760cab7aec4a8359010b0", created_at: "2009-02-15 19:20:07", updated_at: "2009-02-16 19:20:07", remember_token: nil, remember_token_expires_at: nil, activation_code: "1b6453892473a467d07372d45eb05abc2031647a", activated_at: "2009-02-14 19:20:07", state: "active", deleted_at: nil, company_name: "Hotmail", address: nil, zip: nil, city: nil, company_phone: nil, phone: nil>
>> User.last.affiliate_account
=> nil
>> require 'spec'
=> true
>> require 'spec/rails'
=> true
>> User.last.affiliate_account.should_not be_nil
#!/usr/bin/env ruby
require 'rubygems'
require 'trollop'
config = {:step_type => 'Given,When,Then'}
opts = Trollop.options do
opt :step_type, "Given, When or Then", :type => :string, :default => config[:step_type]
end
term = ARGV.last
#
# cucumber.yml
#
# Filter which features are run with each profile by the file extension
webrat: --require features/steps/common --require features/support/webrat_env.rb --exclude selenium.feature --format progress
selenium: --require features/steps/common --require features/support/selenium_env.rb --exclude webrat.feature --format progress
#
# features/support/env.rb
ed out after 0ms (Selenium::CommandError)
/usr/lib/ruby/gems/1.8/gems/selenium-client-1.2.12/lib/selenium/client/protocol.rb:13:in `remote_control_command'
/usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
/usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
/usr/lib/ruby/gems/1.8/gems/selenium-client-1.2.12/lib/selenium/client/protocol.rb:11:in `remote_control_command'
/usr/lib/ruby/gems/1.8/gems/selenium-client-1.2.12/lib/selenium/client/idiomatic.rb:307:in `wait_for_condition'
/usr/lib/ruby/gems/1.8/gems/selenium-client-1.2.12/lib/selenium/client/extensions.rb:27:in `wait_for_element'
## SOLVED!
http://github.com/brynary/webrat/commit/cd49c2d9392df7489653e4819700e910a33e4377

(This is the text of the keynote I gave at Startup Riot 2009. Will update when video becomes available.)

Hi everyone, I’m Chris Wanstrath, and I’m one of the co-founders of GitHub.

GitHub, if you haven’t heard of it, has been described as “Facebook for developers.” Which is great when talking about GitHub as a website, but not so great when describing GitHub as a business. In fact, I think we’re the polar opposite of Facebook as a business: we’re small, never took investment, and actually make money. Some have even called us successful.

Which I’ve always wondered about. Success is very vague, right? Probably even relative. How do you define it?

After thinking for a while I came up with two criteria. The first is profitability. We employ four people full time, one person part time, have thousands of paying customers, and are still growing. In fact, our rate of growth is increasing – which means January was our best month so far, and February is looking pretty damn good.

@edbond
edbond / twitter_app.rb
Created April 3, 2009 10:06 — forked from mbleigh/twitter_app.rb
twitterapp
app_name = ask("What is your application called?")
puts "\nBefore this generator runs you will need to register your Twitter application for OAuth at http://twitter.com/oauth_clients, then enter the consumer key and secret below:\n\n"
consumer_key = ask("OAuth Consumer Key:")
consumer_secret = ask("OAuth Consumer Secret:")
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm README"
run "cp config/database.yml config/database.yml.example"
#!/usr/bin/ruby
require 'rubygems'
require 'activesupport'
require 'couchrest'
$KCODE='u'
require 'jcode'
NGRAM_SIZE=3
@db = CouchRest.database("http://localhost:5984/geo_#{NGRAM_SIZE}")
#!/bin/bash
# usage: time benchbulk.sh dbname
# it takes about 30 seconds to run on my old MacBook
BULKSIZE=1000
DOCSIZE=100
INSERTS=10
ROUNDS=10
DBURL="http://localhost:5984/$1"
#!/usr/bin/ruby
#
# fetch new torrents from torrents.ru
# and display them as notifications
$KCODE='u'
require 'jcode'
require 'rubygems'
require 'net/http'
-module(freq).
-export([main/0]).
freq(B) when is_binary(B) ->
Arr = array:new([{size,256}, {fixed,true}, {default,0}]),
freq(B, Arr).
freq(<<>>, Arr) -> Arr;
freq(<<B:8,Rest/binary>>, Arr) ->
Old = array:get(B, Arr),