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
| Paperclip.interpolates :s3_path_prefix do |attachment, style| | |
| attachment.instance.s3_path_prefix | |
| end |
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
| => {"org"=> | |
| {"mpris"=>{"MediaPlayer2"=>{}}, | |
| "gnome"=> | |
| {"Rhythmbox3"=> | |
| {"menus"=>{"appmenu"=>{}}, | |
| "window"=>{"1"=>{}}, | |
| "PlayQueue"=>{}, | |
| "RhythmDB"=>{}, | |
| "PlaylistManager"=>{}}}}} |
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
| class Foo | |
| def hello | |
| puts "Original Method" | |
| puts caller(1) | |
| end | |
| end | |
| class HijackStuff | |
| def hijack | |
| Foo.class_eval do |
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
| config.to_prepare do | |
| # Load application's model / class decorators | |
| ['lib', 'app'].each do |dir| | |
| Dir.glob(File.join(File.dirname(__FILE__), "../#{dir}/**/*_decorator*.rb")) do |c| | |
| Rails.configuration.cache_classes ? require(c) : load(c) | |
| end | |
| end | |
| end |
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
| class Foo::Bar < ActiveRecord::Base | |
| end | |
| class Foo::Bar::Lols < ActiveRecord::Base | |
| end | |
| Routes.draw do | |
| namespace :foo do | |
| resources :bars do | |
| resources :lols |
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/ruby | |
| #based off jhawthorn's python generic_nofity.py | |
| require 'net/http' | |
| def send_notify(ticker, title, body) | |
| if Weechat.config_get_plugin('account_name') == "" | |
| return Weechat::WEECHAT_RC_OK | |
| end |
NewerOlder