This file contains hidden or 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
# Usage example: | |
# | |
# ruby solution.rb foo@example.com | |
# Marketing channel | |
# Educational: on | |
# Promotions: on | |
# Deals channel | |
# Flight Deals: on | |
# | |
# IMPORTANT NOTE: If a channel is off, all its message types are considered off. |
This file contains hidden or 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
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aa049a47b218fda30f9a4a454119ae067a02cf50/Formula/postgis.rb | |
#pg_config --pkglibdir is useful for finding your $libdir | |
ln -s /usr/local/share/postgresql/extension/postgis* /usr/local/Cellar/postgresql@9.6/9.6.9/share/postgresql@9.6/extension | |
ln -s /usr/local/lib/postgresql/postgis-2.3.so /usr/local/Cellar/postgresql@9.6/9.6.9/lib/postgis-2.3 | |
ln -s /usr/local/lib/postgresql/rtpostgis-2.3.so /usr/local/Cellar/postgresql@9.6/9.6.9/lib/ | |
# Fixes issues with missing | |
brew reinstall gdal2 |
This file contains hidden or 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 hidden or 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
# Step 0: Run 'gem install rouge' on the command line. | |
# Step 1: Download, or copy this snippet to a new file, prettify.rb | |
# Step 2: Prettify your HTML by running this script from the directory where it lives like this | |
# ruby prettify.rb -i <input_file> -o <output_file> | |
# Step 3: Profit! | |
# | |
require 'rouge' | |
require 'optparse' | |
options = Hash.new |
This file contains hidden or 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" | |
require "pry" | |
doc = Nokogiri::HTML(open("http://clatl.com/atlanta/100-dishes/Section?oid=7938072&year=2015")) | |
doc.css('div#gridSpanningHeader li').map do |thing| | |
puts thing.content | |
parsed = /(^.*) at(?: the)? (.*?$)/.match(thing.content) | |
puts "Dish: #{parsed[1]}, Restaurant: #{parsed[2]}" |
This file contains hidden or 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 'rails_helper' | |
RSpec.describe TodosController, :type => :controller do | |
context "GET index" do | |
#context "POST create" do | |
#context "GET show" do | |
#context "PATCH update" do (or PUT update) | |
#context "DELETE destroy" do | |
#context "GET new" do |
This file contains hidden or 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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
This file contains hidden or 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" | |
require "pry" | |
doc = Nokogiri::HTML(open("http://clatl.com/atlanta/100-dishes/Section?oid=7938072&year=2015")) | |
doc.css('div#gridSpanningHeader li').map do |thing| | |
puts thing.content | |
end |