Skip to content

Instantly share code, notes, and snippets.

☁ daicoden daicoden

Block or report user

Report or block daicoden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@daicoden
daicoden / jruby_extensions.rb
Created Nov 17, 2013
Just some ideas for a couple more things I have run into
View jruby_extensions.rb
java_import com.foo.MyJavaClass
java_import com.foo.MyJavaInterface
java_import com.foo.TemplateClass
# Extending from generic superclass
# This is needed because a new type is created, and
# there is no way currently in JRuby to specify template classes
# because most template information is unavailable during runtime
class MyRuby < MyJavaClass(TemplateClass)
end
@daicoden
daicoden / reliable.patch
Last active Dec 27, 2015
Patch for speeding up webrtc with the reliable shim.
View reliable.patch
From 4372eada0cb413d3834abb6a485f0fee5e72345e Mon Sep 17 00:00:00 2001
From: Matt Wilson <mattwilson@squareup.com>
Date: Sat, 9 Nov 2013 06:11:06 -0800
Subject: [PATCH] Booo Fuckin Ya.
---
assets/javascripts/vendor/peer.js | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/assets/javascripts/vendor/peer.js b/assets/javascripts/vendor/peer.js
@daicoden
daicoden / gist:6586144
Created Sep 16, 2013
Patch that would be helpful to ethers if it gets into jruby 1.7.5.
View gist:6586144
JRuby 1.5 cleanup
# COMITTED UPSTREAM - But leaving here in case we need refernce.
# There was some implementation changed, and I didn't have tests to catch everything
# this is here until we can get it commited upstream
module JRuby
class JavaSignature
# FIXME: Can make this accept whole list too if that is actual contract
# FIXME: Can be literals too
def as_java_type(string)
@daicoden
daicoden / injectable.rb
Last active Dec 19, 2015
Minecart Injectable
View injectable.rb
module Minecart
module Injectable
module ClassMethods
# USAGE
# @param field
# The name of the instance variable to set with the injected value
# @param opts
# :with - a ruby java class i.e. (java.lang.String) which the config value can be cast into.
# :named - a string which will be used to retrieve an object annotated with the @Named convention.
# :annotated - a ruby java binding annotation which is used to retrieve the requested object
View gist:1326700
x = X(ittr, :)';
z = theta' * x;
View gist:644509
## spec_helper
Rspec.configure do |config|
config.include Devise::TestHelpers
config.before(:authenticate => :admin) do
#sign_in User.find_by_email("admin@example.com") If you uncomment this it crashes with the nil error
end
end
You can’t perform that action at this time.