Ensure you have homebrew installed. See https://brew.sh
brew install coreutils curl git libyaml asdfEnsure you have homebrew installed. See https://brew.sh
brew install coreutils curl git libyaml asdf| var now = new Date(); | |
| var quarter = Math.floor((now.getMonth() / 3)); | |
| var firstDate = new Date(now.getFullYear(), quarter * 3, 1); | |
| var endDate = new Date(firstDate.getFullYear(), firstDate.getMonth() + 3, 0); |
| # Usage: | |
| # profile_memory do | |
| # # your_code_to_be_profiled_here... | |
| # end | |
| module ProfileUtils | |
| def get_current_memory_usage | |
| `ps -o rss= -p #{Process.pid}`.to_i | |
| end | |
| CC=/usr/local/bin/gcc-4.2 rbenv install ree-1.8.7-2012.02 |
| # The latest version of this script is now available at | |
| # https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh | |
| VERSION=1.9.3-p286 | |
| brew update | |
| brew install rbenv ruby-build rbenv-vars readline ctags | |
| if [ -n "${ZSH_VERSION:-}" ]; then | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc | |
| else | |
| echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile |
| select array_to_string(array_agg(projects.name), ',')) as projects ... |
| # Got from here: http://www.skorks.com/2010/03/timing-ruby-code-it-is-easy-with-benchmark/ | |
| require "benchmark" | |
| Benchmark.bm(7) do |x| | |
| x.report("first:") { (1..10000).each { |i| i } } | |
| x.report("second:") { (1..10000).each { |i| i }} | |
| x.report("third:") { (1..10000).each { |i| i }} | |
| end |
| brew install memcached libmemcached | |
| env ARCHFLAGS="-arch x86_64" gem install memcached --no-ri --no-rdoc -- --with-libmemcached-dir=/opt/local |
| ActiveRecord::Base.connection.instance_variable_set :@logger, Logger.new(STDOUT) |