Skip to content

Instantly share code, notes, and snippets.

View bikezilla's full-sized avatar

Vladimir Konushliev bikezilla

  • Plovdiv, Bulgaria
View GitHub Profile
@bikezilla
bikezilla / rb_office_lunch.rb
Created November 18, 2016 13:06
Ruby script to pick the most appropriate place for lunch for a given subset of people in Sofia RB office
BEEN_TO = [:dragoness, :don_domat, :dragoness, :labottega]
VENUES = [
{id: :dragoness,
travel_time: 10,
service_time: 60,
seating_capacity: 10,
preferences: {
todor: 9,
nikola: 8,
@bikezilla
bikezilla / rails_http_statuses.md
Created November 9, 2016 04:24
Rails HTTP status code symbols
Status Code Status Message Symbol
1xx Informational
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing
2xx Success
200 OK :ok
201 Created :created
202 Accepted :accepted
@bikezilla
bikezilla / bd_quine_30012016.md
Last active February 2, 2016 07:05
The birthday quine reengineered

Obviously start with a lambda

2.2.1 :001 >->{}[]
 => nil

Pass an argument - the current version of the Quine

2.2.1 :002 > ->_{_}["->_{_}"]
 => "->_{_}"
@bikezilla
bikezilla / export_gems.rb
Last active December 3, 2015 09:21
Simple script to export information about gems in a csv.
require 'gems'
require 'csv'
gems_with_versions = `bundle list`.split("\n").map do |line|
next unless line.include? '*'
line.gsub('*','').strip
end.compact
csv_data = gems_with_versions.map do |gem_line|
=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')