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
require 'openssl' | |
class AppUser < Sequel::Model(:AppUsers) | |
AppUser.unrestrict_primary_key | |
def self.authenticate(username, password) | |
#TODO: Store salt in config | |
puts "In Auth" | |
user = self.first(:username => username) |
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
Found by Dima Kovalenko | |
Selenium specs which call "wait for element to be visible" fail on an "Element no longer connected to DOM" error. | |
The problem occurs when the div appears briefly, then goes away. If the loop exits after the div is already off the screen, the call to "wait for element to be visible times out, and causes the spec to fail. | |
This issue can be elusive, only failing intermittently because sometimes the loop exits quickly enough to avoid producing the error. The fact that the div is displayed then hidden was the key to identifying and solving this bug in our test. |
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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "bundler/setup" | |
require "sequel" | |
# DB Config | |
options = { | |
:database => "development", | |
:host => "localhost", |
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
alias pairtunl='ssh -fNR 4242:localhost:22 $1' | |
alias pairinit='tmux -S /tmp/pairing new-session -d -s pairing' | |
alias pairjoin='tmux -S /tmp/pairing attach -t pairing' | |
# alias pairmuch='pairtunl $1 && pairinit && pairjoin' |
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
require 'csv' | |
CSV_FILENAME = "some_names.csv" | |
names_hash = {} | |
matches_array = [] | |
CSV.foreach(CSV_FILENAME) do |row| | |
last_name,first_name = row[0],row[1] |
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
# Functions for RVM | |
rvmrubyversion () {rvm info|grep -C1 "interpreter"|grep "version:"|awk {'print $2'}} | |
rvmrc () {current_path=$(pwd | awk '{split($0,array,"/");print array[length(array)]}') | |
echo "rvm use default@$current_path --create" >> .rvmrc; source .rvmrc} |
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
npm ERR! Error: Failed to mkdir /usr/local: File exists | |
npm ERR! at STATCB (/private/var/folders/1i/1iBDWfZ0FcS+Cwr4gRZ7GU+++TM/-Tmp-/npm.73154/package/lib/utils/mkdir-p.js:117:19) | |
npm ERR! at cb (/private/var/folders/1i/1iBDWfZ0FcS+Cwr4gRZ7GU+++TM/-Tmp-/npm.73154/package/lib/utils/graceful-fs.js:31:9) |
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
A list of books that people have recommended to me about communication: | |
http://t.co/Lsr5t4J - How to Win Friends & Influence People (Dale Carnegie) | |
http://t.co/7CHxjpc - Getting Naked (Patrick Lencioni) | |
http://t.co/vrmhKAh - Pragmatic Thinking and Learning (Andrew Hunt) | |
http://t.co/MmJOPW6 - Life's A Pitch (Stephen Bayley) | |
http://t.co/SW5nLRd - Crucial Conversations (Kerry Patterson) |
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
autocmd User Rails Rnavcommand config config -suffix.rb -default=environment | |
autocmd User Rails Rnavcommand fabricator spec/fabricators -glob=**/* -suffix=_fabricator.rb | |
autocmd User Rails Rnavcommand feature features -suffix=.feature -default=cucumber | |
autocmd User Rails Rnavcommand sass app/stylesheets -glob=**/* -suffix=.sass -default=main | |
autocmd User Rails Rnavcommand scss app/stylesheets -glob=**/* -suffix=.scss -default=style | |
autocmd User Rails Rnavcommand steps features/step_definitions -suffix=_steps.rb -default=web | |
let g:surround_{char2nr("l")} = "link_to \1text: \1, \2path:\2\r" | |
let g:surround_{char2nr("#")} = "#{\r}" |
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
-> % ./prawn_vs_pdfkit.rb | |
user system total real | |
PDFKit: 1.760000 1.850000 231.550000 (286.579597) | |
Prawn: 99.140000 0.890000 100.030000 (102.124293) | |
2.4 GHz Intel Core 2 Duo | |
4 GB 1067 MHz DDR3 |