Skip to content

Instantly share code, notes, and snippets.

@douglasrodrigo
douglasrodrigo / gist:919706
Created April 14, 2011 15:24
vraptor build
Buildfile: c:\eclipse\workspace\vraptor\build.xml
core-tests:
prepare:
compile:
[javac] c:\eclipse\workspace\vraptor\vraptor-core\build.xml:42: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] c:\eclipse\workspace\vraptor\vraptor-core\build.xml:45: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
@douglasrodrigo
douglasrodrigo / lambda_calculus.rb
Created May 28, 2011 03:26
ruby lambda calculus
#base
First = lambda {|a, b| a}
Last = lambda {|a, b| b}
#conditional
True = First
False = Last
Not = lambda {|boolean| boolean[False, True]}
And = lambda {|boolean_a, boolean_b| boolean_a[boolean_b, False]}
Or = lambda {|boolean_a, boolean_b| boolean_a[True, boolean_b]}
@douglasrodrigo
douglasrodrigo / jibernate_adapter_spec
Created September 30, 2011 01:25
jibernate adapter spec execution
douglas@douglas-laptop:~/projetos/jibernate-dm$ rmvn clean gem:initialize
maven commandline: clean gem:initialize -f dm-hibernate-adapter.gemspec.pom
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dm-hibernate-adapter 0.2pre
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ dm-hibernate-adapter ---
[INFO] Deleting /home/douglas/projetos/jibernate-dm/target
@douglasrodrigo
douglasrodrigo / dm-core_dm-hibernate-adapter
Created October 18, 2011 01:34
dm-core reload with dm-hibernate-adapter
douglas@douglas-laptop:~/projetos/dm-core$ rmvn rake spec
maven commandline: de.saumya.mojo:rake-maven-plugin:rake -Dargs="spec" -f Gemfile.pom
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dm-core - gem 0.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- rake-maven-plugin:0.28.1:rake (default-cli) @ dm-core ---
[INFO] (in /home/douglas/projetos/dm-core)
@douglasrodrigo
douglasrodrigo / randexp_specs_JRuby_1.6.4
Created October 28, 2011 01:49
randexp - specs - JRuby - 1.6.4
douglas@douglas-laptop:~/projetos/randexp$ jruby -S rake
rake/gempackagetask is deprecated. Use rubygems/package_task instead
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
at /home/douglas/.rvm/gems/jruby-1.6.4/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
rm -r coverage
/home/douglas/.rvm/gems/jruby-1.6.4/gems/rcov-0.9.11-java/lib/rcov/differential_analyzer.rb:31 warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
Regexp#gen
- should always return a string
@douglasrodrigo
douglasrodrigo / randexp_specs_ruby_1.8.7
Created October 28, 2011 01:52
randexp - specs - ruby - 1.8.7
douglas@douglas-laptop:~/projetos/randexp$ rake
rake/gempackagetask is deprecated. Use rubygems/package_task instead
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
Example disabled: should be a union between 3 sexp's
Example disabled: should return a word or a 3 digit number
Regexp#gen
- should always return a string
Randexp::Parser.parse
@douglasrodrigo
douglasrodrigo / gist:1371798
Created November 16, 2011 23:03
dm-hibernate build
douglas@douglas-laptop:~/projetos/dm-hibernate-adapter$ rmvn rake spec
maven commandline: de.saumya.mojo:rake-maven-plugin:rake -Dargs="spec" -f dm-hibernate-adapter.gemspec.pom
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dm-hibernate-adapter 0.3pre
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- rake-maven-plugin:0.28.1:rake (default-cli) @ dm-hibernate-adapter ---
[WARNING] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.annotations.Version).
@douglasrodrigo
douglasrodrigo / gist:1932353
Created February 28, 2012 12:53
git update
[alias]
update = !sh -c \"git fetch && git rebase origin/$(git symbolic-ref HEAD | sed -e \"s,.*/\\(.*\\),\\1,\")\"
import java.lang.reflect.Field;
import sun.misc.Unsafe;
import sun.reflect.FieldAccessor;
import sun.reflect.ReflectionFactory;
public class Teste {
static {
try {
setValor(Boolean.class, "TRUE", new Boolean(false));
@douglasrodrigo
douglasrodrigo / gist:2032371
Created March 13, 2012 22:48
java allocate
public class ReflectionUtils {
public static <T> T allocate(Class<?> clazz) {
Object instance = null;
Object unsafe = getUnsafe();
Method allocate;
try {
allocate = unsafe.getClass().getDeclaredMethod("allocateInstance", Class.class);
instance = allocate.invoke(unsafe, clazz);
} catch (Exception e) {