Skip to content

Instantly share code, notes, and snippets.

View lkosak's full-sized avatar

Lou Kosak lkosak

  • Airbnb
  • San Francisco, CA
View GitHub Profile
@lkosak
lkosak / eventcmd.rb
Last active March 21, 2016 12:39
eventcmd for mcabber that provides native OSX notifications for incoming messages (requires the terminal-notifier ruby gem)
#!/usr/bin/env ruby
require 'terminal-notifier'
event, arg1, arg2, filename = ARGV
# log = File.open 'eventcmd.log', 'a'
# log.write "#{event}, #{arg1}, #{arg2}, #{filename}\n"
case event
@lkosak
lkosak / gist:3882258
Created October 12, 2012 23:31
cloudfront / s3 comparison
redtail git:master ❯ for i in {,{1..15}}; curl -s -w "%{time_total}\n" -o /dev/null http://assets2.pinchit.com/assets/application-30d3705e5123eae4ffbe76a846c616cc.css
0.101
0.089
0.071
0.115
0.079
0.055
0.065
0.066
0.053
Given I can pinch in San Francisco # features/step_definitions/backgroud_steps.rb:1
@selenium
Scenario: Url Pinch # features/pinching_from_add_button.feature:8
When I visit the homepage for San Francisco # features/step_definitions/web_steps.rb:3
And I click the Add button # features/step_definitions/add_button.rb:1
And I choose to create a pinch from the add dialog # features/step_definitions/add_button.rb:56
And I enter a URL # features/step_definitions/add_button.rb:63
And I create a new pinch using the form # features/step_definitions/add_button.rb:79
Element is not clickable at point (0, 0). Other element would receive the click: <div data-js="dialog-overlay" class="dialog-overlay dialog-overlay--modal">...</div> (Selenium::WebDriver::Error::UnknownError)
keen_test ❯ curl https://api.keen.io/3.0/projects/5060bf05897a2c3ccd000001/events \
-H "Authorization: dae45ea3c1f545579513d2196ff6782f" \
-H "Content-Type: application/json" \
-d @purchase.json
{
"error_code": "InternalServerError",
"message": "An internal server error occurred.",
"stacktrace_id": "-6266315450578604209",
"unique_id": "-6266315450578604209-1348717756988"
}%
times = []
for i in 1..15
res = `curl -s -w "%{time_connect}:%{time_starttransfer}\n" -o /dev/null http://www.pinchit.com/api/v1/markets/san-francisco/music\?limit\=50\&market\=san-francisco\&abc\=$i`
connect, transfer = res.strip.split(":").map { |t| t.to_f }
time = (transfer - connect).round(3)
times << time
puts time
end
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" RUNNING TESTS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>t :call RunTestFile()<cr>
map <leader>rt :call RunNearestTest()<cr>
map <leader>. :call RunTests('')<cr>
map <leader>c :w\|:!cucumber %<cr>
map <leader>w :w\|:!script/acceptance --profile wip<cr>
function! RunTestFile(...)
for i in {,{1..15}}; curl -s -w "%{time_total}\n" -o /dev/null http://127.0.0.1:3000/api/v1/markets/san-francisco/music\?limit\=50\&market\=san-francisco\&abc\=$i
redtail git:master ❯ gem install nokogiri ⏎
Building native extensions. This could take a while...
Successfully installed nokogiri-1.5.5
1 gem installed
Installing ri documentation for nokogiri-1.5.5...
Installing RDoc documentation for nokogiri-1.5.5...
Installing nokogiri (1.5.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/lkosak/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
redtail git:master ❯ rails s
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
=> Booting Thin