Skip to content

Instantly share code, notes, and snippets.

View rscottm's full-sized avatar

Scott Moyer rscottm

View GitHub Profile
%##############################################################################################
%#
%# This code takes the @callbacks hash (read out of the interfaces.yml file) and prepares
%# it for use in the code below.
%#
% implements = []
% constants = []
% @callbacks.each do |interface,i_info|
% i_info.each do |method,v|
% v["interface"] = interface.gsub("$", ".")
We couldn’t find that file to show.
@rscottm
rscottm / MyDateSetListener.java
Created November 7, 2010 22:53
Java classes created by the experimental subclass and interfce gen code
package org.scottmoyer.test;
import org.jruby.Ruby;
import org.jruby.javasupport.util.RuntimeHelpers;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.javasupport.JavaUtil;
import org.jruby.exceptions.RaiseException;
import org.ruboto.Script;
public class MyDateSetListener implements android.app.DatePickerDialog.OnDateSetListener {
@rscottm
rscottm / glsurfaceview.rb
Created December 1, 2010 16:03
GLSurfaceView ruboto demo ported from Android demos
require 'ruboto'
java_import "android.opengl.GLSurfaceView"
java_import "javax.microedition.khronos.egl.EGL10"
java_import "javax.microedition.khronos.egl.EGLConfig"
java_import "javax.microedition.khronos.opengles.GL10"
java_import "java.nio.ByteBuffer"
java_import "java.nio.ByteOrder"
@rscottm
rscottm / android_api_gen.rb
Created December 19, 2010 05:14
This is the code I used to build the android_api.xml file from the X.xml files (where X is 1-9) pulled from the ASOP project
#######################################################
#
# android_api_gen.rb (by Scott Moyer)
#
# This is the code I used to build the android_api.xml
# file from the X.xml files (where X is 1-9) pulled
# from the ASOP project.
#
# To get the individual versions (something like):
#
@rscottm
rscottm / script_server.rb
Created December 19, 2010 07:10
Experimental webrick server to allow editing of scripts on the device
#######################################################
#
# script_server.rb (by Scott Moyer)
#
# This is an experiment in creating a web server on
# an android handset for the purpose of editing scripts.
#
#######################################################
# Need to require date separately. You get a stack overflow
require 'ruboto.rb'
ruboto_import_widgets :TextView, :LinearLayout, :Button
java_import 'android.content.Intent'
java_import "android.util.Log"
java_import 'android.provider.MediaStore'
java_import 'android.net.Uri'
java_import 'java.io.File'
java_import 'java.io.FileNotFoundException'
@rscottm
rscottm / Data
Created September 9, 2011 06:09
Cycle through various versions of ruboto-core and jruby-jars to collect stack information
Ruboto: 0.2.1
JRuby: 1.5.6
0:40
1:61
2:69
3:86
Ruboto: 0.2.1
JRuby: 1.6.X
0:42
1:66
@rscottm
rscottm / ruboto_generate.rb
Created March 22, 2012 22:35
Initial pass at using the dexmaker project to generate Ruboto callbacks
######################################################
#
# ruboto_generate.rb (by Scott Moyer)
#
# This is an initial pass at using the dexmaker
# project (http://code.google.com/p/dexmaker/) to
# generate Ruboto callbacks. The first half of this
# script generates the callback. The second half is
# the standard demo-opengl.rb script with minor
# modifications to allow it to use the generated
@rscottm
rscottm / javap output
Created November 22, 2012 08:43
baksmali output
public final class org.jruby.proxy.java.math.BigInteger$Proxy0 extends java.math.BigInteger implements org.jruby.javasupport.proxy.InternalJavaProxy{
public org.jruby.proxy.java.math.BigInteger$Proxy0(int, int, java.util.Random, org.jruby.javasupport.proxy.JavaProxyInvocationHandler);
Code:
0: aload_0
1: iload_1