Skip to content

Instantly share code, notes, and snippets.

View valo's full-sized avatar
👷‍♂️
buidling

Valentin Mihov valo

👷‍♂️
buidling
View GitHub Profile
$ ab -c 10 -n 100 http://178.62.172.238/rankings_practice
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 178.62.172.238 (be patient).....done
Server Software: nginx/1.4.6
@valo
valo / README.md
Last active August 29, 2015 14:07

Extracting the bar calculation into a separate object, which doesn't know about Foo, allows us to test this code in more isolation and to easily change it in the future, because of its reduced context.

Keybase proof

I hereby claim:

  • I am valo on github.
  • I am valo (https://keybase.io/valo) on keybase.
  • I have a public key whose fingerprint is 2C5B D381 351D 02B7 E0EF 002D 0E81 39C9 3B22 1782

To claim this, I am signing this object:

require 'rubygems'
require 'mechanize'
require 'tidied_html_page.rb'
a = WWW::Mechanize.new do |agent|
agent.user_agent_alias = 'Mac Safari'
agent.log = Logger.new(File.open('parser.log', 'w+'))
agent.pluggable_parser.html = TidiedHTMLPage
agent.pluggable_parser.xhtml = TidiedHTMLPage
end
@valo
valo / env.rb
Created October 20, 2009 17:19
require 'spec/expectations'
require 'webrat'
Webrat.configure do |config|
config.mode = :mechanize
end
class MechanizeWorld < Webrat::MechanizeAdapter
end
curl http://europe.wsj.com/home-page > wsj.html
curl --data-binary @wsj.html g.pdfgenapp.com > wsj.pdf
module AttributeBuilder
def initialize(attrs = {})
attrs ||= {}
attrs.each do |key, value|
self.send("#{key}=", value)
end
end
end
module MemberBuilder
import java.util.ArrayList;
import java.util.List;
public class School {
private List<SchoolClass> m_classes = new ArrayList<SchoolClass>();
private List<SchoolRoom> m_rooms = new ArrayList<SchoolRoom>();
public School() {
}
@valo
valo / ideas.txt
Created May 12, 2011 12:41
Blog post topics
Namespaces in Ruby: what is the difference between
class A::B
end
and
module A
class B
end
@asp1 = Factory(:asp, :name => "ASP1", :school_name => "School 1", :school_district => "District 1", :region_id => regions(:us_co).id)
@asp2 = Factory(:asp, :name => "ASP2", :school_name => "School 2", :school_district => "District 2", :region_id => regions(:us_co).id)
@asp3 = Factory(:asp, :name => "ASP3", :school_name => "School 3", :school_district => "District 3", :region_id => regions(:us_co).id)
@asp4 = Factory(:asp, :name => "ASP4", :school_name => "School 4", :school_district => "District 3", :region_id => regions(:us_co).id)