Skip to content

Instantly share code, notes, and snippets.

View chhhris's full-sized avatar
🚁
Working From Helicopter

Christopher Lake chhhris

🚁
Working From Helicopter
View GitHub Profile
@chhhris
chhhris / mind_games_poem.txt
Last active March 15, 2019 21:51
"Mind Games" Outline
Foreward


"If it sounds to you like everything that could go wrong is going wrong, then I would have to agree.
"Do you know what it is? What’s causing all this misery and suffering?
"I know now, but for a long time, I had no idea why my luck had turned. Why my deepest and darkest fears had manifested themselves into real life.
"For a long time, I thought I was alone. Of course by now, I know I am not alone. And other people who thought they were alone, now realize the truth as well.
@chhhris
chhhris / api_calls.md
Last active January 5, 2018 20:24
Skyscanner flight price discrepancy
# ruby
params = {
  :country=>"US", 
  :currency=>"USD", 
  :locale=>"en-US", 
  :locationSchema=>"iata", 
  :apikey=>"ve518156965014636303894819187830", 
  :originplace=>"JFK-sky", 
 :adults=>1, 
@chhhris
chhhris / find_file.sh
Created June 2, 2016 17:41
Bash script for searching directory with list of file names passed as array
declare -a array=("add-student.png" "assessment-progressbar.png" "blank.gif" "browse.png" "cert-altiusEd.png" "cert-p-completion.png" "cert-p-grat.gif" "cert-p-l.gif""cert-p-r.gif" "cert-signature-b.png" "ckeditor-helix-icons.png" "completion-badge-print.png" "crop.png" "dialog-close.png" "fb-share.png""helix-fb-share-cert.png" "ibc-logo-4c.png" "logo_footer.png" "logo_img.png" "logo_text.png" "online-status.png" "remove-18.png" "share-board.png""sprite-40plus.png" "sprites.png" "stack-large.png" "stack-medium.png" "stack-small.png" "start-date.png" "test/announce.png" "texture.png""ui-bg_flat_0_878787_40x100.png" "ui-bg_flat_0_aaaaaa_40x100.png" "ui-bg_flat_75_ffffff_40x100.png" "ui-bg_glass_55_fbf9ee_1x400.png""ui-bg_glass_65_ffffff_1x400.png" "ui-bg_glass_75_bcdbf0_1x400.png" "ui-bg_glass_75_dadada_1x400.png" "ui-bg_highlight-soft_75_dbdbdb_1x100.png""ui-bg_highlight-soft_95_fad3d1_1x100.png" "ui-icons_222222_256x240.png" "ui-icons_333333_256x240.png" "ui-icons_454545_256x240.png""ui-icons_4f4f4f_256x240.p
@chhhris
chhhris / capybara cheat sheet
Created October 27, 2015 15:49 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=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')
#!/usr/bin/env ruby
class Solver
B = " "
attr_reader :sudoku_board
def initialize
@sudoku_board = [[B, 4, B, B, B, 5, B, 1, B],
[B, B, B, B, 1, B, 6, B, 9],
[6, B, 1, 9, 3, B, B, B, 4],
require 'nokogiri'
require 'open-uri'
url = "http://www.gutenberg.org/files/2701/2701-h/2701-h.htm"
doc = Nokogiri::HTML(open(url))
words = doc.text.downcase
.gsub(/[^\w\s]/,'') # remove non word or space characters
.gsub(/\n/,' ') # remove new lines
.gsub(/\s+/,' ') # normalize spaces (only one space ever)
.split("chapter one").first # remove preamble
@chhhris
chhhris / sort_by_note_date
Created July 31, 2014 17:37
sort_by note date
@session.deals.all(stage: :incoming).sort_by do |deal|
(deal.notes.all.present? && deal.notes.all.last[:updated_at]) ||
deal[:updated_at]
end
@chhhris
chhhris / live-emails-dev-mode.rb
Last active January 4, 2016 20:49
Sending live emails in development mode
# now with Mandrill
# with SENDGRID
# sending emails to your email while in development mode.
# mail_interceptor.rb
if Rails.env.development?
message.to = 'your@email.com'
// iOS Media Queries
// Goal: capture styles for iPhone, iPhone 3G, iPhone 3GS, iPhone 4, iPhone 4S, iPad, and iPad 2
//
// Author: Tony Schneider (@tonywok)
// Please tell me where I fail. :)
// iPhone v(4,4S) portrait
// test: black text (overwritten by v* portrait) with blue background
@media all and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait) {
a {