This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.events.find({"name":"purchased_deal","is_first_time":{$exists:false}}).forEach(function(data) { | |
var query = { | |
"name" : data.name, | |
"user_id" : data.user_id, | |
"date_created": { $lt : data.date_created } | |
} | |
if(db.events.count(query) == 0) { | |
data.is_first_time = true | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"pinch_cards": [ | |
{ | |
"qr_code": | |
-or- | |
"pinch_card_term_id": | |
-or- | |
"pinch_card_id": | |
"punch_count": | |
"punches": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Paste into your .vimrc | |
" for insert mode remap <c-l> to: | |
" Insert a hash rocket for ruby | |
" Insert a -> for php | |
function! SmartHash() | |
let ruby = &ft == 'ruby' | |
let php = &ft == 'php' | |
if php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! RunRailsTest() | |
let file = expand("%") | |
let basepath = getcwd() | |
let in_test_file = match(file, '\(.feature\|_spec.rb\|_test.rb\)$') != -1 | |
if !in_test_file | |
" Come up with a best guess search path | |
let search_fname = fnamemodify(file, ":s?^app/??:s?.rb$?_spec.rb?") | |
" Search for that shit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redtail git:master ❯ rails s | |
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8 | |
=> Booting Thin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 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(...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer