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
#!/bin/bash | |
# Function displaying wrong usage information | |
# Proper usage is: ./dev_start.sh Rails-Project-Folder | |
usage() | |
{ | |
cat << EOF | |
usage: $0 Rails-Project-Folder | |
EOF | |
} |
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
Workshop | |
- try ember when writing a single page app, angular has a shitty router | |
- lineman.js | |
Friday: | |
1. Monorail problem | |
- propono gem - Pub-Sub architecture | |
2. Matz |
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
// ---- | |
// Sass (v3.4.4) | |
// Compass (v1.0.1) | |
// ---- | |
// Mixin approach | |
@mixin btn | |
{ | |
min-width: 8rem; | |
font-family: "League Gothic"; |
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
class PersonValidator < SimpleDelegator | |
include ActiveModel::Validations | |
validates :name, presence: true | |
end | |
class Validator < ActiveModel::Validator | |
class Factory | |
@validators = {} | |
def self.register(klass, validator) |
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
module Defaults | |
module Result1 | |
def self.call(input_a:, input_b:, bank_param_1:, **kwargs) | |
(input_a + input_b) * bank_param_1 | |
end | |
end | |
module Result2 | |
def self.call(result_1:, input_c:, **kwargs) | |
result_1 / input_c |
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
class BankA | |
def parameters | |
{ | |
bank_param_1: 0.6, | |
bank_param_2: 60, | |
} | |
end | |
def evaluation_steps | |
{ |
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
class BankB | |
def parameters | |
{ | |
bank_param_1: 0.5, | |
bank_param_2: 65 | |
} | |
end | |
def evaluation_steps | |
{ |
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
RAW_INPUT = { | |
input_a: 10, | |
input_b: 20, | |
input_c: 30 | |
} |
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
class DataWrapper | |
def initialize(data_hash) | |
raise ArgumentError unless data_hash.is_a? Hash | |
@data_hash = data_hash | |
end | |
def add(name, value) | |
DataWrapper.new(data_hash.merge({ name.to_sym => value })) | |
end |
OlderNewer