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 / tmux-iterm2.rb
Last active December 10, 2015 11:48
Homebrew custom build script for Tmux and Iterm2.
require 'formula'
class TmuxIterm2 < Formula
url 'http://iterm2.googlecode.com/files/iTerm2-1_0_0_20121224.zip'
sha1 'a2ea1cb72f3cef193d929c1580ef82710bc7345b'
head 'git://tmux.git.sourceforge.net/gitroot/tmux/tmux'
depends_on 'pkg-config' => :build
depends_on 'libevent'
@owenthereal
owenthereal / run-test262-nailgun.sh
Created October 17, 2012 03:21
Run ecmascript test262 suite for Dynjs with nailgun
#!/bin/sh
# Usage:
#
# * copy this file to the test262 folder
# * start nailgun server with `ng-server`
# * run suite with `sh run-test262-nailgun.sh <dynjs-folder>`
if [ $# = 0 ]
then
@owenthereal
owenthereal / ch15
Created October 17, 2012 00:29
specs result for dynjs 2
ch15/15.1/S15.1_A1_T1 failed in non-strict mode as expected
ch15/15.1/S15.1_A1_T2 failed in non-strict mode as expected
ch15/15.1/S15.1_A2_T1 failed in non-strict mode as expected
ch15/15.1/15.1.1/15.1.1.1/15.1.1.1-0 passed in non-strict mode
ch15/15.1/15.1.1/15.1.1.1/S15.1.1.1_A1 passed in non-strict mode
ch15/15.1/15.1.1/15.1.1.1/S15.1.1.1_A3.1 passed in non-strict mode
ch15/15.1/15.1.1/15.1.1.1/S15.1.1.1_A3.2 passed in non-strict mode
ch15/15.1/15.1.1/15.1.1.2/15.1.1.2-0 passed in non-strict mode
ch15/15.1/15.1.1/15.1.1.2/S15.1.1.2_A1 passed in non-strict mode
ch15/15.1/15.1.1/15.1.1.2/S15.1.1.2_A2_T2 passed in non-strict mode
@owenthereal
owenthereal / bestPractice
Created October 17, 2012 00:17
specs result for dynjs
bestPractice/Sbp_12.5_A9_T3 failed in non-strict mode as expected
bestPractice/Sbp_12.6.1_A13_T3 failed in non-strict mode as expected
bestPractice/Sbp_12.6.2_A13_T3 failed in non-strict mode as expected
bestPractice/Sbp_12.6.4_A13_T3 failed in non-strict mode as expected
=== bestPractice/Sbp_7.8.4_A6.1_T4 was expected to fail in non-strict mode, but didn't ===
=== bestPractice/Sbp_7.8.4_A6.2_T1 was expected to fail in non-strict mode, but didn't ===
=== bestPractice/Sbp_7.8.4_A6.2_T2 was expected to fail in non-strict mode, but didn't ===
=== bestPractice/Sbp_7.9_A9_T3 failed in non-strict mode ===
--- errors ---
Exception in thread "main" org.dynjs.parser.SyntaxError: /var/folders/vt/nrnb_cw95ps51fgmm9rq2mpw0000gn/T/test262-Lyte7s.js line 2180:16 no viable alternative at input 'true'
@owenthereal
owenthereal / DisruptorTest.java
Created August 9, 2012 18:53 — forked from jbrisbin/DisruptorTest.java
Disruptor RingBuffer-based simplistic NIO HTTP test server
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.StandardSocketOptions;
import java.nio.ByteBuffer;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
@owenthereal
owenthereal / turn_off_web_sharing_in_mountain_lion.sh
Created July 26, 2012 18:20
turn off web sharing in Mountain Lion
$ sudo apachectl stop
$ sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
@owenthereal
owenthereal / failing_test_for_step_exp
Created July 20, 2012 04:54
failing_test_for_step_exp
java.lang.ArrayIndexOutOfBoundsException: 0
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at org.objectweb.asm.tree.ClassNode.accept(Unknown Source)
at me.qmx.jitescript.JiteClass.toBytes(JiteClass.java:151)
at org.dynjs.compiler.DynJSCompiler.defineClass(DynJSCompiler.java:160)
at org.dynjs.compiler.DynJSCompiler.compile(DynJSCompiler.java:150)
@owenthereal
owenthereal / type_checking.clj
Created April 28, 2012 21:54
Show case of Clojure's powerful meta-programming system
user=> (defn type_checking [^String s] (.toUpperCase s))
#'user/type_checking
user=> (type_checking 12)
ClassCastException java.lang.Long cannot be cast to java.lang.String user/type_checking (NO_SOURCE_FILE:43)
user=> (defn no_type_checking [s] (.toUpperCase s))
#'user/no_type_checking
user=> (no_type_checking 12)
IllegalArgumentException No matching field found: toUpperCase for class java.lang.Long clojure.lang.Reflector.getInstanceField (Reflector.java:271)
@owenthereal
owenthereal / error
Created February 23, 2012 14:57
error when installing posix-spawn gem with JRuby 1.6.7
Installing posix-spawn (0.3.6) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/Owen/.rvm/rubies/jruby-1.6.7/bin/jruby extconf.rb
WARNING: JRuby does not support native extensions or the `mkmf' library very well.
Check http://kenai.com/projects/jruby/pages/Home for alternatives.
creating Makefile
make
cc -I. -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include -I/Users/Owen/.rvm/rubies/jruby-1.6.7/lib/native/include/ruby -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fPIC -DTARGET_RT_MAC_CFM=0 -fno-omit-frame-pointer -fno-strict-aliasing -fexceptions -Wall -arch i386 -c posix-spawn.c
@owenthereal
owenthereal / start_command
Created February 16, 2012 23:41
start_command
/usr/bin/jsvc -home /usr/lib/jvm/java-6-openjdk/jre -wait 20 -pidfile /data/partner-mdm/shared/pids/trinidad.pid -user ubuntu -procname jsvc-trinidad -jvm server -outfile /data/partner-mdm/shared/log/trinidad.log -errfile &1 -cp /home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/ruby/gems/1.8/gems/trinidad_init_services-1.1.2/trinidad-libs/jruby-jsvc.jar:/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/ruby/gems/1.8/gems/trinidad_init_services-1.1.2/trinidad-libs/commons-daemon.jar:/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/jruby.jar -Djna.boot.library.path=/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/native/linux-i386:/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/native/linux-amd64 -Djffi.boot.library.path=/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/native/i386-Linux:/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/native/s390x-Linux:/home/ubuntu/.rbenv/versions/jruby-1.6.6/lib/native/x86_64-Linux -Djruby.shell=/bin/sh -Djruby.home=/home/ubuntu/.rbenv/versions/jruby-1.6.6 -Djruby.lib=/home/ubuntu/.rbenv/versions/jruby-1