Skip to content

Instantly share code, notes, and snippets.

View owenthereal's full-sized avatar
🚀
Hacking

Owen Ou owenthereal

🚀
Hacking
View GitHub Profile
@owenthereal
owenthereal / jruby-openssl_failed_specs
Created February 14, 2012 04:36
jruby-openssl failed specs
1) Error:
test_bit_string_infinite_length(OpenSSL::TestASN1):
NameError: uninitialized constant OpenSSL::ASN1::EndOfContent
org/jruby/RubyModule.java:2626:in `const_missing'
/Users/Owen/workspace/jruby-ossl/test/1.9/test_asn1.rb:519:in `test_bit_string_infinite_length'
org/jruby/RubyBasicObject.java:1694:in `__send__'
/Users/Owen/workspace/jruby-ossl/test/../build_lib/mocha/lib/mocha/integration/mini_test/version_142_and_above.rb:27:in `run'
2) Failure:
test_cons_explicit_tagging(OpenSSL::TestASN1) [/Users/Owen/workspace/jruby-ossl/test/1.9/test_asn1.rb:408]:
@owenthereal
owenthereal / sudoers
Created September 30, 2011 23:52
CMND Alias for Ngninx
Cmnd_Alias DEVSERVER = /opt/nginx/sbin/nginx, /bin/kill
mdesrosiers ALL = NOPASSWD: DEVSERVER
@owenthereal
owenthereal / active_record_store.rb
Created September 27, 2011 04:36
Comparison between the DataMapper gem and the ActiveRecord gem
class Store < ActiveRecord::Base
has_many :products
belongs_to :user
validates_presence_of :name
end
> Store.create(:name => "Amazon")
> Store.where(:name => "Amazon")
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
class User < ActiveRecord::Base
include TablelessColumns
tableless_column :license_accepted, :boolean
# other fields that are corresponding to table columns
end
module TablelessColumns
def self.included(base)
- build_config
- build.properties
ant -Dbuild.compiler=org.eclipse.jdt.core.JDTCompilerAdapter
-Dant.build.javac.target=1.6
-Dant.build.javac.source=1.6 compile
class Baz implements Serializable {
private A a;
private B b;
private C c;
...
}
public class SourceEditorFactory {
private static IConfigurationElement cachedConfigurationElement;
private static final String ATTRIBUTE_CLASS = "class";
public static ITextEditor createSourceEditor() {
if (cachedConfigurationElement == null) {
cachedConfigurationElement = readConfigurationElement();
}
<dependency>
<groupId>HelloWorld</groupId>
<artifactId>HelloWorldProxy</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>