# ruby
params = {
:country=>"US",
:currency=>"USD",
:locale=>"en-US",
:locationSchema=>"iata",
:apikey=>"ve518156965014636303894819187830",
:originplace=>"JFK-sky",
:adults=>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
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. |
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
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 |
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
=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') |
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 | |
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], |
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 '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 |
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
@session.deals.all(stage: :incoming).sort_by do |deal| | |
(deal.notes.all.present? && deal.notes.all.last[:updated_at]) || | |
deal[:updated_at] | |
end |
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
# now with Mandrill | |
# with SENDGRID | |
# sending emails to your email while in development mode. | |
# mail_interceptor.rb | |
if Rails.env.development? | |
message.to = '[email protected]' |
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
// 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 { |
NewerOlder