##Rollin with the Install
####Stage 1 - Ruby Version Manager
go to rvm.io copy and paste the two commands
# Phoenix | |
if grep -q '^ "phoenix"' mix.lock; then | |
source $HOME/.asdf/asdf.sh | |
source $HOME/.asdf/completions/asdf.bash | |
export $(cat $RELEASE_DIR/../../.rbenv-vars | xargs) | |
echo ' | |
-----> Detected Phoenix app.' | |
mix local.rebar --force | |
mix local.hex --force |
# Signal catching | |
def shut_down | |
puts "\nShutting down gracefully..." | |
sleep 1 | |
end | |
puts "I have PID #{Process.pid}" | |
# Trap ^C | |
Signal.trap("INT") { |
##Rollin with the Install
####Stage 1 - Ruby Version Manager
go to rvm.io copy and paste the two commands
require 'minitest/autorun' | |
require 'minitest/reporters' # optional | |
Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new() # optional | |
require_relative './allergies' | |
class AllergiesTest < MiniTest::Test |
In the game of chess, a queen can attack pieces which are on the same row, column, or diagonal.
A chessboard can be represented by an 8 by 8 array.
Write a program that positions two queens on a chess board and indicates whether or not they are positioned so that they can attack each other.
###The Ultimate Life Decider Never make a decision again!
####Part One a. - The Coin of Inevitability
decider.js
coinFlip
that 'console.logs' HEADS
or TAILS
when calledWINNER
in the console when either HEADS or TAILS is flipped 5 times.// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
###PT PLANNER ####Melbourne Public Transport Journey Planner
There are 3 train lines:
The Alamein line has the following stops: Flinders Street, Richmond, East Richmond, Burnley, Hawthorn, and Glenferrie.
The Glen Waverly line has the following stops: Flagstaff, Melbourne Central, Parliament, Richmond, Kooyong and Tooronga.
The Sandringham line has the following stops: Southern Cross, Richmond, South Yarra, Prahran, and Windsor.
#Heroku, Ruby on Rails and PhantomJS
In this post, I’m going to show you how to modify an existing Ruby on Rails app running on Heroku’s Cedar stack to use PhantomJS for screen scraping. If you’ve never heard of PhantomJS, it’s a command-line WebKit-based browser (that supports JavaScript, cookies, etc.).
Let’s get started. This is a high-level overview of the required steps:
# Add poltergeist gem to Gemfile, in :test group, | |
# then run `bundle` to install | |
group :test do | |
... | |
gem 'poltergeist' | |
... | |
end |