Skip to content

Instantly share code, notes, and snippets.

View henrrrik's full-sized avatar

Henrik Sjökvist henrrrik

  • Mobility46
  • Stockholm, Sweden
View GitHub Profile
@hannesl
hannesl / application.rb
Last active December 23, 2015 06:49
Use English in Rails admin even though you're using a different default locale for the app.
...
# Use Swedish as default locale.
config.i18n.default_locale = :sv
...
@henrrrik
henrrrik / 20120118012543_create_site_configuration.rb
Created October 25, 2012 11:58 — forked from bigfive/20120118012543_create_site_configuration.rb
Ruby on Rails. Key value table for site configuration integrated with Active Admin and Formtastic forms. Updated to use erb instead of haml.
# db/migrations/20120118012543_create_site_configuration.rb
class CreateSiteConfigurations < ActiveRecord::Migration
def change
create_table :site_configurations do |t|
t.string :key
t.text :value
t.string :form_type
t.string :form_collection_command
@mrrooijen
mrrooijen / rbenvsudo.sh
Created April 3, 2012 10:29
A little shell function that allows you to perform rbenv (gem) commands with sudo privileges. Similar to rvmsudo.
function rbenvsudo(){
executable=$1
shift 1
sudo $(rbenv which $executable) $*
}