- 📆 2019-04-19
- this spans many weeks / investment times
- 📹 Screencast: Functional Structures
- 👨💻📝️ an experienced OOP programmer learning FP and Scala
- and maybe category theory? 🤔
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
--color | |
--require spec_helper |
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
################################# | |
# GEMFILE: gem 'get_process_mem' | |
################################# | |
require 'get_process_mem' | |
def profile_mem(description=nil) | |
mb = GetProcessMem.new.mb | |
puts "\n\n---- #{ description } - MEMORY USAGE(MB): #{ mb.round } ----\n\n" | |
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
# Shared specs for models with the `:validates_numericality_of` validators. | |
# Usage: pass a hash of each of the symbolized names of each options for the | |
# numericality validator. If the option has a value with which to evaluate | |
# against, add it as the value of that option hash name. | |
# E.g.: | |
# `it_behaves_like :validates_numericality_model, :numeric_attr, { greater_than_or_equal_to: 0, only_integer: true }` | |
RSpec.shared_examples :validates_numericality_model do |attribute_name, options| | |
it { is_expected.to validate_numericality_of(attribute_name) } |
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 RequestSpecHelper::SessionsHelper | |
# Set single expectation that checks auth headers were returned. | |
def expect_auth_headers(response) | |
expect(response.headers.keys).to include('access-token', 'client', 'expiry', 'uid') | |
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
( (1.year.ago.to_date)..(Date.today) ).select{ |d| (1..5).include? d.wday }.size.to_f |
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
function clearswap { sudo swapoff -a && sudo swapon -a; } |
- 📆 2019-07-19
- this spans many weeks / investment times
- 📖 🌳️🕵♀️️ The Elm Language Guide
- 👨💻📝️ an experienced OOP programmer learning FP and Elm
Compared to my experiences using JavaScript over many years, I found installing