Skip to content

Instantly share code, notes, and snippets.

Version: ImageMagick 6.8.6-3 2013-09-15 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC Modules
Delegates: bzlib freetype jng jpeg png tiff xml zlib

Recently, I had a staging database on Heroku that was running on the Ronin database (which was originally the lowest-sized DB you could get at Heroku). Since they added two new options, Crane and Kappa, we wanted to take advantage of the cost savings. Here's how you can migrate your Ronin DB to Crane (or any other plan).

The old database was named BROWN while the new one is CRIMSON. You can determine this by running:

heroku pg:info --app myapp-staging
  1. Add Crane database

     heroku addons:add heroku-postgresql:crane --app myapp-staging
    

heroku pg:wait --app myapp-staging

@jyr
jyr / vim.rb
Last active December 18, 2015 00:09 — forked from mgrouchy/vim.rb
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
url 'https://vim.googlecode.com/hg/', :revision => '6c318419e331'
version '7.3.515'
def features; %w(tiny small normal big huge) end
def interp; %w(lua mzscheme perl python python3 tcl ruby) end
@jyr
jyr / Vagrantfile
Created April 9, 2013 16:14
My Vagrantfile for drupal
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "nuperty-drupal"
@jyr
jyr / alarm.sh
Created December 21, 2012 19:07
YOUR_ISP=www.google.com
while :
do
ping -t 2 -o -c 1 $YOUR_ISP || open alarm.wav
sleep 1
done
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "nuperty"
Monquiro.Views ||= {}
class Monquiro.Views.GoogleMapView extends Backbone.View
# A Backbone View always holds a div element in his @el variables.
id: 'map' # Sets the id of the @el div
initialize: () ->
$(@el).css('width','100%') # You can access the @el div with jQuery even if it's not yet on the document.
$(@el).css('height','600px')
@map = null
@jyr
jyr / map.js
Created October 7, 2012 21:39
example backbone render map
Backbone.js Events not firing
MapModalView = Backbone.View.extend({
events: {
'click #closeMapModal': 'closeModal',
'click #modal_streetview': 'renderStreet'
},
initialize: function(){
this.el = $('.modal_box');
this.template = _.template($('#map-modal-template').html());
_.bindAll(this, 'renderMap', 'renderPin');
@jyr
jyr / to_csv.rb
Created September 20, 2012 22:53
cvs generator
#!/usr/local/bin/ruby -w
require "csv"
CSV_FILE_PATH = File.join(File.dirname(__FILE__), "input.csv")
CSV.foreach(CSV_FILE_PATH) do |row|
puts "ROW -- #{row}"
end
CSV_FILE_PATH_OUT = File.join(File.dirname(__FILE__), "output.csv")
@jyr
jyr / array_to_hash.rb
Created August 17, 2012 02:38
convert array to hash
1.9.2p318 :001 > a= ['a','b','c','d']
=> ["a", "b", "c", "d"]
1.9.2p318 :002 > b = [1,2,3,4]
=> [1, 2, 3, 4]
1.9.2p318 :003 > c = a.zip(b).flatten.compact
=> ["a", 1, "b", 2, "c", 3, "d", 4]
1.9.2p318 :004 > h = Hash[*c.flatten]
=> {"a"=>1, "b"=>2, "c"=>3, "d"=>4}