Skip to content

Instantly share code, notes, and snippets.

View firedev's full-sized avatar
👁️
👁

Nick Ostrovsky firedev

👁️
👁
View GitHub Profile
@firedev
firedev / localized.rb
Last active March 27, 2020 04:53
Easy localization for Rails model attributes. Models should have attributes ending with `_<locale>`, i.e. `title_en`, `title_ru`. `attr_translated :title` will add a `.title` method. If `.title_<current_locale>` is empty, `.title_en` will be returned.
# localized.rb
#
# Usage:
#
# include Localized
# attr_translated :title
#
# Model.title now returns title_<locale> or falls back to title_en
#
@firedev
firedev / Railscasts.tmTheme
Created June 18, 2012 11:56
Improved Railscasts Theme for Sublime Text 2 – Makes sure you have a differently colored text selection instead of black on black
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0.sublime">
<dict>
<key>name</key>
<string>Railscasts</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>