Skip to content

Instantly share code, notes, and snippets.

View martennilsson's full-sized avatar

Mårten Nilsson martennilsson

  • HomeQ
  • Stockholm
View GitHub Profile
class Channel < ActiveRecord::Base
include 'singleton'
class Earth
include Singleton
end
a, b = Earth.instance, Earth.instance
a == b
#=> true
Earth.new
def verified
source.try(:verified)
end
delegate :verified, :to => :source, :allow_nil => true
- (void)startStandardUpdates
{
if (nil == locationManager)
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyKilometer;
locationManager.distanceFilter = 10;
[locationManager startUpdatingLocation];
}
class Car
attr_accessor :engine
delegate :start, :stop, :to => :engine
def initialize(engine)
@engine = engine
end
end
class Engine
class Car
attr_accessor :engine
def initialize(engine)
@engine = engine
end
def start_engine
@engine.start
end
class Car
attr_accessor :engine
def initialize(engine)
@engine = engine
end
def start_engine
@engine.start
end
java.lang.SecurityException: class "json.ext.Parser$s_method_0_1$RUBYINVOKER$newInstance"'s signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(ClassLoader.java:807)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:488)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:626)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at org.jruby.util.JRubyClassLoader.defineClass(JRubyClassLoader.java:22)
at org.jruby.internal.runtime.methods.InvocationMethodFactory.endClass(InvocationMethodFactory.java:1281)
at org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethodClass(InvocationMethodFactory.java:755)
at org.jruby.internal.runtime.methods.InvocationMethodFactory.getAnnotatedMethod(InvocationMethodFactory.java:685)
at org.jruby.RubyModule.defineAnnotatedMethod(RubyModule.java:794)
def list
session[:total_sources] ||= Source.count
session[:source_search_params] ||= {}
@search_params = session[:source_search_params]
filter_list()
end