## Install [node]( via [homebrew]( and update [npm](
# install node version with LTS (Long Term Support)
brew install node4-lts
# update npm
npm install npm -g
# check versions
node -v
View benchmark.ruby-set-and-array-unique-insert.rb
require 'benchmark'
require 'set'
NUMBERS = 5000.times.collect { rand(10) }
Benchmark.bmbm do |x|"set") do
set =
NUMBERS.each do |number|
set.add number
# provisioning a rails stack with
# - ngixn web server and reverse proxy
# - puma app server
# - redis
# - elasticsearch
# - Amazon RDS using etc for the SQL database
# installed on an AWS EC2 instance running Ubuntu 14.04 LTS
# fix locale.
# needed to remove login warning
View docs confused why we need `extern crate` and use both.txt
as a rust noob and coming from ruby
was confused why we need `extern crate` and `use` both ?
the `guessing-game` chapter has these two paragraphs:
The first thing we’ve done is change the first line. It now says
`extern crate rand`. Because we declared `rand` in our `[dependencies]`, we
can use `extern crate` to let Rust know we’ll be making use of it. This also
does the equivalent of a `use rand;` as well, so we can make use of anything
View debug-rails-app-written-by-other.txt
1. view paths ?
2. where are the layout and view file located ?
3. is the database.yml valid ?
sanity check: eyeball if it is running locally.
4. any "very" old libs and/or known security vulnerabilities ?
for (1) can delete a partial and see the stacktrace
something like
View Cargo.lock
name = "hello_world"
version = "0.0.1"
dependencies = [
"rand 0.3.14 (registry+",
name = "libc"
version = "0.2.10"
View example nginx config.txt
# rails config needs `force_ssl`
# example:
# Force all access to the app over SSL, use Strict-Transport-Security,
# and use secure cookies.
# config.force_ssl = true
# and rails needs some headers to be set, otherwise will be trapped in a redirect loop
# nginx config for headers:
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto https;
View running overcommit hooks.23-feb-2016.txt
git commit
/usr/local/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/overcommit-0.32.0/lib/overcommit/git_version.rb:12: warning: Insecure world writable dir /usr in PATH, mode 040777
Running pre-commit hooks
Check for trailing whitespace....................[TrailingWhitespace] OK
✓ All pre-commit hooks passed
/usr/local/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/overcommit-0.32.0/lib/overcommit/git_version.rb:12: warning: Insecure world writable dir /usr in PATH, mode 040777
Running commit-msg hooks
Check subject line................................[SingleLineSubject] OK
View overcommit
  • add overcommit. to catch things like, long commit messages

    echo "2.3.0" > .ruby-version gem install overcommit overcommit --install overcommit --sign run overcommit --list (to see list of hooks) run overcommit --run (to test it out once)

    some interesting hooks to try out, but not enabled:

alias ip="dig +short"
alias localip="ipconfig getifaddr en0"