View tmp.cmd
amol_termsheet|fast!$ rf | grep Completed
Spring is not running
20:09:45 web.1 | Completed 200 OK in 5593ms (Views: 2031.4ms | ActiveRecord: 338.0ms)
20:09:50 web.1 | Completed 200 OK in 657ms (Views: 636.6ms | ActiveRecord: 7.4ms)
20:09:58 web.1 | Completed 200 OK in 604ms (Views: 579.4ms | ActiveRecord: 7.9ms)
20:10:08 web.1 | Completed 200 OK in 639ms (Views: 616.0ms | ActiveRecord: 9.8ms)
20:10:11 web.1 | Completed 200 OK in 657ms (Views: 635.3ms | ActiveRecord: 8.5ms)
20:10:17 web.1 | Completed 200 OK in 754ms (Views: 727.1ms | ActiveRecord: 7.7ms)
20:10:19 web.1 | Completed 200 OK in 680ms (Views: 655.1ms | ActiveRecord: 8.6ms)
20:10:20 web.1 | Completed 200 OK in 553ms (Views: 528.5ms | ActiveRecord: 8.5ms)
View rvm2rbenv.txt
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################
View test1.rb
### write your solution here
module M
def method_m
puts 'from m...'
end
end
module N
def method_n
View class variables and instance variables.rb
In Ruby class variables are denoted by `@@`, and instance variables are denoted by `@`
Instance variables
- are private to the class instance, cannot be accessed outside class unless shared
- they cannot be accessed outside class instance methods
- they get inherited
Class variables
- are private to the class instance, cannot be accessed outside class unless shared
- they cannot be accessed outside class instance methods
View array_iteration_thoughts.md

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

View flatten_my_array.rb
# This is a custom method to flatten any given array
# this is simple one to read and understand
# by name it means to accept only array, so it is known that passing any other object than array will fail
def flatten_my_array arr
new_arr = []
arr.each do |element|
if element.is_a? Array
new_arr = new_arr.concat flatten_my_array(element)
# know that Array#concat is faster way to concat two arrays in ruby
View annualized_return.rb
if investment and investment.deal and investment.deal.annual_return.present?
return investment.deal.annual_return.to_i
end
return 0 if projected_earnings.blank?
return 0 if percent_profit.blank?
return 0 if percent_profit.to_f < 1
year_diff = projected_earnings.last.distribution_date.d_date.year.to_i - DateTime.now.year.to_i
View simple_captcha.rb
module Liquid
module Tags
module SimpleCaptcha
class HumanTest < ::Liquid::Tag
include ::ActionView::Helpers::FormTagHelper
include ::SimpleCaptcha::ViewHelper
attr_accessor :request, :session
def render(context)
View pipable.rb
# Elixir has pipes `|>`. Let's try to implement those in Ruby.
#
# I want to write this:
#
# email.body | RemoveSignature | HighlightMentions | :html_safe
#
# instead of:
#
# HighlightMentions.call(RemoveSignature.call(email.body)).html_safe
#
View egauge_simulator.py
push_url = None
auth_string = None
register_names = []
reporting_interval = 60
min_reporting_interval = 5
max_reporting_interval = 600
sampling_interval = 1