This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'rails-i18n', '~> 4.0.0' | |
## Gives javascript access to translations. | |
gem "i18n-js" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] | |
config.i18n.default_locale = "en-US" | |
config.i18n.available_locales = ["es-MX", "en-US"] | |
config.assets.initialize_on_precompile = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root to: redirect("/#{I18n.default_locale}", status: 302), as: :redirected_root | |
scope "(:locale)", locale: /#{I18n.available_locales.join("|")}/ do | |
resources :users | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
before_filter :prepare_for_mobile | |
private | |
## Is this a mobile device? | |
def mobile_device? | |
if session[:mobile_param] | |
session[:mobile_param] == "1" | |
else | |
request.user_agent =~ /Mobile|webOS/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
ENV.update YAML.load_file('config/mio.yml')[Rails.env] | |
rescue => e | |
logger.fatal "Failed to load MIO YAML file: #{e.message}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
development: &development | |
mio_api_url: "http://localhost:9004/api/" | |
mio_api_username: "test_username" | |
mio_api_key: "super secret key" | |
test: | |
<<: *development | |
production: | |
mio_api_url: "https://top_secret.url/api/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/cleartarget | |
/tar Drywind Bonepicker | |
/tar Gorebound Legionnaire | |
/tar Sethekk Prophet | |
/tar Warsong Marauder | |
/tar Necrophyte | |
/tar Thunderlord Giantslayer | |
/tar Shadowmoon Voidtwister | |
/stopmacro [@target,noexists] | |
/tm 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Quiz | |
constructor: (@quizCollection) -> | |
create: (description, options) -> | |
check description, String | |
check options, Array | |
if options.length is 0 | |
throw new Meteor.Error('Must specify options.') | |
@quizCollection.insert { | |
description: description, | |
options: options, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.3.js"></script> | |
<script> | |
var checkStatus = function(streamer, $span) { | |
jQuery.getJSON('https://api.twitch.tv/kraken/streams/' + streamer + '/?callback=?', function(json) { | |
if (json.stream) { | |
$span.html($span.attr('data-twitch-online')); | |
} else { | |
$span.html($span.attr('data-twitch-offline')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'yaml' | |
puts YAML.load_file('test.yaml').inspect |
OlderNewer