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
"Windom, MN [Windom Municipal Airport], USA", | |
"Montevideo, MN [Montevideo-Chippewa County Airport], USA", | |
"La Gomera Airport", | |
"Hebei Handan Airport", | |
"Osvaldo Vieira International Airport", | |
"Sam Mbakwe International Cargo Airport", | |
"Weihai Dashuibo Airport", | |
"Aéroport de Lille", | |
"Dubai International Airport", | |
"Brussels Midi Railway Station", |
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
LATEST_DUMP=$(ls -tr ~/tempfiles | tail -n 1) | |
dropdb -h localhost -U webapp webapp_development && createdb -h localhost -U webapp webapp_development | |
psql -h localhost -U webapp -f ~/tempfiles/$LATEST_DUMP -d webapp_development -e |
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 'integration' | |
require 'bigdecimal/math' | |
# Calculates the weighted costs of ER credits from a list of given vintages and their contained ERs. | |
# Early vintages have higher prices allowing later vintages to be less effected by initial costs. | |
class VintageCostCalculation | |
# Calculating raises an error if the sum of vintage ERs multiplied with the ER costs in this | |
# vintage differs from the given project costs by more than ACCEPTABLE_PROJECT_COST_DIFFERENCE. | |
ACCEPTABLE_PROJECT_COST_DIFFERENCE = 16 |
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
# frozen_string_literal: true | |
namespace :db_performance do | |
desc 'Tests how badly written db calculations perform against ruby' | |
task(test: :environment) do | |
DBQueryPerformance.test | |
end | |
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
-- Assuming we have a list of items in the model (type alias Model = { items : List Item } | |
-- where Item is a record like { id : Int, name : String } | |
-- The following goes in the view and generates an html dropdown. | |
-- In my example I get: | |
-- The argument to function `onSelect` is causing a mismatch. | |
-- Function `onSelect` is expecting the argument to be: | |
-- Int -> a | |
-- But it is: |
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
Show hidden characters
{ | |
"bold_folder_labels": true, | |
"caret_style": "blink", | |
"color_scheme": "Packages/User/Solarized (Light) (SL).tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"extra_file_exclude_patterns": | |
[ | |
"*.pyc", | |
"*.pyo", | |
"*.exe", |
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
Documentation: | |
Enabled: false | |
Style/IfUnlessModifier: | |
MaxLineLength: 100 | |
Style/WhileUntilModifier: | |
MaxLineLength: 100 | |
Style/AlignHash: | |
Enabled: false | |
Metrics/LineLength: |
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 bash | |
apt-get -y update | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev git-core | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make | |
make install |
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 bash | |
apt-get -y update | |
apt-get -y install git-core build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make | |
make install |