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
// make a beatbox | |
import java.awt.*; | |
import javax.swing.*; | |
import javax.swing.event.ListSelectionEvent; | |
import javax.swing.event.ListSelectionListener; | |
import java.io.*; | |
import javax.sound.midi.*; | |
import java.util.*; |
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
ActionDispatch::Callbacks.to_prepare do | |
# monkey patch here | |
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
ActionDispatch::Callbacks.to_prepare do | |
Devise::Oauth2Providable::Client.class_eval do | |
attr_accessible :name, :website, :redirect_uri, :development_mode | |
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
a = "\"\n\nprint \"a = \\\"\"\nprint a.inspect[1..-2]\nprint a\n" | |
print "a = \"" | |
print a.inspect[1..-2] | |
print a |
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
module MongoInstrumenter | |
class LogSubscriber < ActiveSupport::LogSubscriber | |
def self.runtime=(value) | |
Thread.current["mongoid_query_runtime"] = value | |
end | |
def self.runtime | |
Thread.current["mongoid_query_runtime"] ||= 0 | |
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
module Mongo | |
module ControllerRuntime | |
extend ActiveSupport::Concern | |
protected | |
attr_internal :mongo_runtime | |
def cleanup_view_runtime | |
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
#place this inside config/initializers/ | |
require 'oauth/request_proxy/typhoeus_request' | |
module OAuthFix | |
def self.included(base) | |
base.send :include, InstanceMethods | |
base.module_eval %q{ | |
alias_method :old_post_parameters, :post_parameters |
NewerOlder