# Install postgres
brew install postgres
# Create folder for logs
mkdir -p /usr/local/var/postgres/
# Set permissions
chmod 700 /usr/local/var/postgres
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
# Some info | |
# http://www.drurly.com/blog/2012/09/08/create-a-rails-4-project/ | |
# http://stackoverflow.com/questions/12333726/how-to-create-a-rails-project-using-rails-master-beta-4-0-0 | |
git clone https://github.com/rails/rails.git | |
ruby rails/railties/bin/rails new fooapp --dev | |
rails -v # => Rails 4.0.0.beta | |
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
# Running only fast tests on command line | |
`zeus test -t ~slow spec` | |
# Getting the profiling information for RSpec runs | |
`echo "--profile">> .rspec` | |
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
// Compile with: | |
// export RUBY_DIR=$HOME/.rvm/rubies/ruby-1.9.3-p448 | |
// gcc-4.6 -o for_1.9.3 -I$RUBY_DIR/include/ruby-1.9.1/x86_64-darwin12.4.1 -I$RUBY_DIR/include/ruby-1.9.1/ruby/backward -I$RUBY_DIR/include/ruby-1.9.1 -Iext/geoip -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fno-common -pipe for_1.9.3.c -L. -L$RUBY_DIR/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -L. -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl/lib -liconv -lruby.1.9.1 -lGeoIP -liconv -lpthread -ldl -lobjc | |
#include "ruby.h" | |
int t() { GeoIP_record_by_ipnum(); return 0 |
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
env LDFLAGS=-L/usr/local/Cellar/geoip/1.5.1/lib CFLAGS=-I/usr/local/Cellar/geoip/1.5.1/include gem install geoip-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
require 'delegate' | |
require 'securerandom' | |
# Demo solution for Stenver's refactoring problem | |
class Fruit | |
attr_accessor :description, :weight | |
def initialize(description, weight) | |
@description = description |
- in ~/.inputrc:
"\M-d": backward-kill-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
- iTerm2 preferences: Profiles -> Keys
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
Settings |
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 'thwait' | |
$LOAD_PATH << '/Users/madisnoemme/code/etventure/rbn-be-api' | |
threads = 10000.times.map { | |
print "." | |
Thread.new { | |
require_relative './rbn/service/xml/mapping' | |
require_relative './rbn/service/xml/mappings' | |
} | |
} |
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
def build_tree(root_id:) | |
root_row = db_find(id: root_id) | |
root_node = | |
{ | |
id: root_id, | |
text: root_row[:text] | |
} | |
add_children(root_node, db_find_children(parent_id: root_id)) | |
root_node | |
end |