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
begin | |
require 'resque/tasks' | |
task "resque:setup" => :environment | |
rescue LoadError | |
$stderr.puts "*" * 40 | |
$stderr.puts "The resque gem is required to run it's tasks" | |
$stderr.puts "*" * 40 | |
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
static int | |
genericCallback(cpArbiter *arb, cpSpace * space, | |
void * data, ID func) | |
{ | |
int arity = 3; | |
/* int arity = rb_obj_method_arity((VALUE) data, func); */ | |
/* XXX: this doesn't work. */ | |
VALUE arbiter = Qnil; | |
cpShape *a = NULL; | |
cpShape *b = NULL; |
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
## | |
# From: http://d.hatena.ne.jp/falkenhagen/20090702/1246503899 | |
# | |
# Quick-n-dirty helper module method for testing the results of | |
# using #send_file in your controllers | |
## | |
module SendFileHelper | |
def file_body | |
output = StringIO.new |
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
# Given a YAML file located in /config and an environment name, make any | |
# configuration settings available as the given symbol. | |
# | |
# class Example | |
# include LoadsYamlConfig | |
# loads :my_config, 'my_config.yml', 'development' | |
# end | |
# | |
module LoadsYamlConfig | |
def self.included(base) # :nodoc: |
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
/* Basically, I want to throw a custom exception from C++. I'm kind of lost on how to do that :/ */ | |
// exceptions.hpp | |
class V8UnknownReturnValueException : public Rice::Exception { | |
}; | |
Rice::Object rb_eUnknownReturnValueException; |
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
roelofs@trillian [master]~/src/gosu/trunk $ gdb ruby | |
GNU gdb (GDB) 7.0-ubuntu | |
Copyright (C) 2009 Free Software Foundation, Inc. | |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> | |
This is free software: you are free to change and redistribute it. | |
There is NO WARRANTY, to the extent permitted by law. Type "show copying" | |
and "show warranty" for details. | |
This GDB was configured as "i486-linux-gnu". | |
For bug reporting instructions, please see: | |
<http://www.gnu.org/software/gdb/bugs/>... |
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
0xdb43cdde is not id value | |
/usr/lib/ruby/gems/1.8/gems/chipmunk-ffi-0.2.2/lib/chipmunk-ffi/space.rb:137:in `_id2ref' | |
/usr/lib/ruby/gems/1.8/gems/chipmunk-ffi-0.2.2/lib/chipmunk-ffi/space.rb:137:in `add_collision_func_old' | |
/usr/lib/ruby/gems/1.8/gems/chipmunk-ffi-0.2.2/lib/chipmunk-ffi/space.rb:284:in `call' | |
/usr/lib/ruby/gems/1.8/gems/chipmunk-ffi-0.2.2/lib/chipmunk-ffi/space.rb:284:in `cpSpaceStep' | |
/usr/lib/ruby/gems/1.8/gems/chipmunk-ffi-0.2.2/lib/chipmunk-ffi/space.rb:284:in `step' | |
./src/../config/../../../lib/gamebox/physical_stage.rb:33:in `update_physics' | |
./src/../config/../../../lib/gamebox/physical_stage.rb:32:in `times' | |
./src/../config/../../../lib/gamebox/physical_stage.rb:32:in `update_physics' | |
./src/../config/../../../lib/gamebox/physical_stage.rb:47:in `update' |
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
/** | |
* Rice's memory management works on these Allocation_Strategy-s. Define | |
* for a specific class to control if Rice takes care of allocation, deallocation, neither or both (default is both) | |
*/ | |
namespace Rice { | |
template<> | |
struct Default_Allocation_Strategy< BowlineWindow > { | |
static BowlineWindow * allocate() { return new BowlineWindow(); } | |
static void free(BowlineWindow * obj) { } |
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
diff --git a/extconf.rb b/extconf.rb | |
index e4274eb..3f138fb 100644 | |
--- a/extconf.rb | |
+++ b/extconf.rb | |
@@ -27,6 +27,8 @@ env = "" | |
if RUBY_PLATFORM =~ /darwin10/ | |
other_opts = "--disable-dependency-tracking" | |
env = "ARCHFLAGS='-arch x86_64'" | |
+elsif RUBY_PLATFORM =~ /darwin9/ | |
+ env = "ARCHFLAGS='-arch #{`uname -p`.chomp}'" |
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
CL_Size CL_Size_minus(CL_Size self, CL_Size against) { | |
return self - against; | |
} | |
extern "C" | |
void Init_clanlib() | |
{ | |
Rice::Data_Type<CL_Size> cSize = Rice::define_class<CL_Size>("Size"); | |
cSize.define_method("-", &CL_Size_minus); | |
} |