Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:infoName can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337.
Note: Don't do this on a production evniroment!
Get the heroku database name:
heroku pg:infoName can be found in the reponse from the command above. For example: Add-on: soaring-newly-1337.
| def Process.gsub pat, sub | |
| mem = File.open('/proc/self/mem', 'r+') | |
| maps = File.open('/proc/self/maps') | |
| maps.each do |map| | |
| from, to, perms, offset = map.scan(/(\h+)-(\h+) (\S+) (\h+)/)[0] | |
| if perms['rw'] | |
| from, to = [from, to].map { |addr| addr.hex + offset.hex } | |
| data = mem.tap { |m| m.seek from }.read(to - from) rescue next |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
xcode-select --install will prompt up a dialog)Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
| class DynamicStylesheet | |
| # logical_path = 'app/assets/stylesheets/custom.css.scss.erb' | |
| def render(logical_path, data={}) | |
| path = Rails.root.join(logical_path) | |
| context = env.context_class.new(env, logical_path, Pathname.new(path)) | |
| # TODO Change to Tilt.templates_for(file) in Tilt 2.x | |
| templates = [Tilt::ERBTemplate, Sass::Rails::ScssTemplate] |
| gem 'ice_cube' |
| find . -type f | xargs -I {} bash -c "iconv -f utf-8 -t utf-16 {} &>/dev/null || echo {}" > utf8_fail |
Quick benchmark to see how ice_cube behaves in the far future. It seems that the cost is linearly increasing.
Results at: http://bit.ly/pjsQH1
(note: second version is without the time parse in the loop)
| s = IceCube::Schedule.new(Time.now, :duration => 3600 * 7) | |
| s.add_recurrence_rule IceCube::Rule.daily.day(:monday, :tuesday, :wednesday, :thursday, :friday).hour_of_day(9) | |
| s.occurring_at?(Time.new(2011, 5, 30, 10, 0, 0)) # true, monday at 10am | |
| s.occurring_at?(Time.new(2011, 5, 29, 10, 0, 0)) # false, sunday at 10am | |
| s.occurring_at?(Time.new(2011, 5, 30, 8, 0, 0)) # false, monday at 8am |