Skip to content

Instantly share code, notes, and snippets.

View mkuhnt's full-sized avatar

Markus Kuhnt mkuhnt

View GitHub Profile
@andreypronin
andreypronin / setup_hstore.rb
Last active August 22, 2016 02:09
Migration to enable hstore for PostgreSQL with Rails 4. See also http://platformonrails.wordpress.com/2013/03/17/using-postgres…e-with-rails-4/
class SetupHstore < ActiveRecord::Migration
def self.up
enable_extension "hstore"
end
def self.down
disable_extension "hstore"
end
end
@mxriverlynn
mxriverlynn / 1-old.js
Created July 24, 2011 19:01
model binding example for backbone
AddEditView = Backbone.View.extend({
events: {
"change input": "fieldChanged",
"change select": "selectionChanged",
},
selectionChanged: function(e){
var field = $(e.currentTarget);
var value = $("option:selected", field).val();