Skip to content

Instantly share code, notes, and snippets.

require 'active_record'
ActiveRecord::Base.logger = Logger.new( STDOUT )
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:username => "philco",
:password => "",
:database => "amazon_db"
@ml242
ml242 / travis.rake
Created November 22, 2013 15:19 — forked from phlco/.travis.yml
namespace :travis do
desc "Prepare DB and run Tests"
task :run do
["rake db:create", "rake db:migrate RAILS_ENV=test", "rake db:seed"
"rspec spec", "rake jasmine:ci"].each do |cmd|
puts "Starting to run #{cmd}..."
system("bundle exec #{cmd}")
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
=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')
@ml242
ml242 / rails_setup.rb
Last active December 30, 2015 01:29 — forked from phlco/rails_setup.rb
# README
# pass in this file when creating a rails project
#
# for example:
# rails _3.2.14_ new awesome_app -d postgresql -m ~/rails_setup.rb
remove_file "README.rdoc"
create_file "README.md", "TODO"
gem_group :development, :test do
# README
# pass in this file when creating a rails project
#
# for example:
# rails _3.2.14_ new awesome_app -T -d postgresql -m ~/.kickhash_template.rb
remove_file "README.rdoc"
create_file "README.md", "TODO"
gem_group :development, :test do

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@ml242
ml242 / gist:9121573
Created February 20, 2014 19:39 — forked from panuta/gist:1852087

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action
# Adapted from the javascript implementation at http://sedition.com/perl/javascript-fy.html
# Randomizes the order of elements in the passed in array in place.
fisherYates = (arr) ->
i = arr.length;
if i == 0 then return false
while --i
j = Math.floor(Math.random() * (i+1))
tempi = arr[i]
[
"5 Days With 5 Scholars: History, NAS, Marine Resources, US Constitution, and Hum",
"Across the Dakotas: Adventure Along the Missouri River",
"Alaska Up and Down: From the Arctic Coast to the North Pacific Fjords",
"Another Day, Another Scholar",
"America''s Musical Theater/Astronomy/History of Lake Arrowhead",
"Wolf: An In-Depth Study/Introduction to Astronomy/Walk in the Clouds: View of Li",
"W.E.B. Dubois and the Black Experience",
"Different View of Santa Fe: A Vantage Point That Will Surprise You!",
"The Grand Canyon: Natural & Human History & the Historic Grand Canyon Railway",
@ml242
ml242 / tinder-api-documentation.md
Created December 11, 2015 15:44 — forked from rtt/tinder-api-documentation.md
Tinder API Documentation

Tinder API documentation

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

Note: this was written in April/May 2014 and the API may have changed since

API Details