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 Kernel | |
def self.fork | |
raise NotImplementedError | |
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
# after doing a piston import ... under vendor/gems for a specific bleeding-edge gem | |
config.gem: Unpacked gem resque in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. | |
config.gem: Unpacked gem resque in vendor/gems not in a versioned directory. Giving up. | |
rake aborted! |
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
# after doing a piston import ... under vendor/gems for a specific bleeding-edge gem | |
config.gem: Unpacked gem resque in vendor/gems has no specification file. Run 'rake gems:refresh_specs' to fix this. | |
config.gem: Unpacked gem resque in vendor/gems not in a versioned directory. Giving up. | |
rake aborted! |
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
require 'erb' | |
data = { :version => RUBY_PLATFORM } | |
class Hash | |
def method_missing(method,*args) | |
if (keys.include?(method) && args.empty?) | |
self[method] | |
else | |
super |
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
* install ironruby in c:\ironruby (msi installer) | |
* install rspec: | |
igem install rspec | |
* copy the binaries: | |
copy C:\ironruby\Lib\ironruby\gems\1.8\bin\spec C:\ironruby\bin\ispec | |
copy C:\ironruby\lib\ironruby\gems\1.8\bin\spec.bat C:\ironruby\bin\ispec.bat |
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
# Thinking-sphinx 1.1.3 didn't already support model.sphinx_attributes['@geodist'] | |
# Here's a work-around in case you need something that works | |
# after your search: | |
@items.each_with_geodist do |item,geodist| | |
item.geodist_sphinx_cache = geodist | |
end | |
# on your model: |
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
# here's what I used to get HopToad to work with Rails Metal | |
class Gateway | |
def self.call(env) | |
begin | |
# fake error trigger | |
if env["PATH_INFO"] =~ /^\/push\/error/ | |
puts "Raising..." | |
raise "Test error!" | |
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
def apply(input0:float[], output0:float[], sampleFrames:int) | |
output0[0] = @a1 * input0[0] + @a2 * @ih1_1 + @a3 * @ih1_2 - @b1*@oh1_1 - @b2*@oh1_2 | |
output0[1] = @a1 * input0[1] + @a2 * input0[0] + @a3 * @ih1_1 - @b1*output0[0] - @b2*@oh1_1 | |
sample = 2 | |
while sample < sampleFrames | |
output0[sample] = @a1*input0[sample] + @a2*input0[sample-1] + @a3*input0[sample-2] - @b1*output0[sample-1] - @b2*output0[sample-2] | |
sample += 1 | |
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
# White-list based approach to only log what's relevant | |
# in Resque Hoptoad notifications. | |
# | |
# Disclaimer: this is provided as-is. Write your own tests. | |
# I can't be held responsible if this code still logs sensitive | |
# information into HopToad or contains bugs or whatever. | |
# | |
# This assume a single Hash arg for the Job. Example of use: | |
Resque::Failure::SensitiveHoptoad.configure do |config| |
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
Dir["**/*.jar"]. | |
reject { |e| e =~ /^mobile/ }. | |
each do |f| | |
puts "======= #{f} ===========" | |
system("jar -tf #{f} | grep JSGPanel") | |
end |