Skip to content

Instantly share code, notes, and snippets.

# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111

This is how we test that all translation keys match up between locales.

Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".

@murugan-r
murugan-r / 0-readme.md
Created October 2, 2012 07:57 — forked from burke/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

Overview

This script installs a patched version of ruby 1.9.3-p194 with boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches.

@murugan-r
murugan-r / add.js.erb
Created July 4, 2012 08:20 — forked from amardaxini/add.js.erb
redis i18n
<tr>
<td><%[email protected](".").drop(1) %></td>
<td><%= @value%></td>
</tr>
@murugan-r
murugan-r / gist:3046056
Created July 4, 2012 08:19 — forked from lunks/gist:953763
i18n issue
class Order < ActiveRecord::Base
has_many :order_items
validates_length_of :order_items, :minimum => 1, :message => :empty
accepts_nested_attributes_for :order_items
end
#en.yml
activerecord: