Skip to content

Instantly share code, notes, and snippets.

View luism's full-sized avatar
:octocat:
Working from home

Luis Mender luism

:octocat:
Working from home
  • Tucuman, Argentina
View GitHub Profile
@luism
luism / event.rb
Created January 6, 2014 11:20 — forked from bbonamin/event.rb
#app/models/event.rb
class Event < ActiveRecord::Base
translates :title, :description
has_many :event_translations
accepts_nested_attributes_for :event_translations, :allow_destroy => true
end
# db/migrate/20111218135715_globalize_models.rb
class GlobalizeModels < ActiveRecord::Migration
def up
NewsItem.create_translation_table!(
{:title => :string, :body => :text},
{:migrate_data => true}
)
end
@luism
luism / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@luism
luism / ruby-style-guide.md
Created February 13, 2016 20:16
A community-driven Ruby coding style guide

Prelude

Role models are important.
-- Officer Alex J. Murphy / RoboCop

One thing has always bothered me as a Ruby developer - Python developers have a great programming style reference ([PEP-8][]) and we never got an official guide, documenting Ruby coding style and best practices. And I do believe that style matters. I also believe that a great hacker community, such as Ruby has,