This file contains hidden or 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
| if Rails.env.production? | |
| require 'fileutils' | |
| FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets", "admin")) | |
| template_path_one = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/app/assets/stylesheets" | |
| template_path_two = "#{Gem.loaded_specs['activeadmin'].full_gem_path}/lib/active_admin/sass" | |
| old_compile_path = "#{Rails.root}/public/stylesheets/admin" | |
| new_compile_path = "#{Rails.root}/tmp/stylesheets/admin" | |
| Sass::Plugin::remove_template_location template_path_one |
This file contains hidden or 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
| # I18n_routing/lib/I18n_routing_common.rb | |
| # Return the correct translation for given values | |
| def self.translation_for(name, type = :resources, option = nil) | |
| # First, if an option is given, try to get the translation in the routes scope | |
| if option | |
| default = "{option}Noi18nRoutingTranslation" | |
| t = I18n.t(option, :scope => "routes.#{name}.#{type}", :default => default) | |
| return (t == default ? nil : t) | |
| else |
This file contains hidden or 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
| # We need this to fix the random timeout error that we were seeing in CI. | |
| # May be related to: http://code.google.com/p/selenium/issues/detail?id=1439 | |
| Capybara.register_driver :selenium_with_long_timeout do |app| | |
| client = Selenium::WebDriver::Remote::Http::Default.new | |
| client.timeout = 120 | |
| Capybara::Driver::Selenium.new(app, :browser => :firefox, :http_client => client) | |
| end | |
| Capybara.javascript_driver = :selenium_with_long_timeout |
This file contains hidden or 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
| window.addEventListener("blur", function () { | |
| if (ig.system) { | |
| ig.music.stop(); | |
| ig.system.stopRunLoop(); | |
| } | |
| }, false); | |
| window.addEventListener("focus", function () { | |
| if (ig.system) { | |
| ig.music.play(); |
This file contains hidden or 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/env ruby | |
| # Twitter Hashtag Counter | |
| # | |
| # Script to count a twitter hashtag and save the result and last_tweet_id to | |
| # hashtag_counter_result.txt and last_tweet_id.txt | |
| # | |
| # Requirements: twitter gem. | |
| # To install twitter gem: [sudo] gem install twitter | |
| require 'rubygems' |
NewerOlder