Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Christopher Lake chhhris

🏠
Working from home
Block or report user

Report or block chhhris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chhhris
chhhris / mind_games_poem.txt
Last active Mar 15, 2019
"Mind Games" Outline
View mind_games_poem.txt
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 Jan 5, 2018
Skyscanner flight price discrepancy
View api_calls.md
# ruby
params = {
  :country=>"US", 
  :currency=>"USD", 
  :locale=>"en-US", 
  :locationSchema=>"iata", 
  :apikey=>"ve518156965014636303894819187830", 
  :originplace=>"JFK-sky", 
  :adults=>1, 
@chhhris
chhhris / find_file.sh
Created Jun 2, 2016
Bash script for searching directory with list of file names passed as array
View find_file.sh
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
View 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')
View gist:6c29b9ada4f06d55b507
#!/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],
View moby_dick.rb
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
View 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 Jan 4, 2016
Sending live emails in development mode
View live-emails-dev-mode.rb
# 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'
View ios-test.css
// 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 {
You can’t perform that action at this time.