This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"*": | |
... | |
'runner': | |
'scopes': | |
'coffee': 'coffee' | |
'js': 'node' | |
'ruby': 'jruby' | |
'python': 'python' | |
'go': 'go run' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.monkstone; | |
import java.nio.file.WatchEvent; | |
interface CodeListener { | |
public void code_event(WatchEvent<?> event); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load_library :chooser | |
attr_reader :img, :data, :skip, :poster | |
########### | |
# Sophisticated example of file chooser. | |
########### | |
KEYS = %w(0 4 5 6 7 8 9) | |
def settings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo add-apt-repository ppa:webupd8team/java | |
sudo apt-get update | |
sudo apt-get install oracle-java8-installer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return a full path to an item in the data folder as a File object. | |
* See the dataPath() method for more information. | |
*/ | |
public File dataFile(String where) { | |
// isAbsolute() could throw an access exception, but so will writing | |
// to the local disk using the sketch path, so this is safe here. | |
File why = new File(where); | |
if (why.isAbsolute()) return why; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Earth model with bump mapping, specular texture and dynamic cloud layer. | |
# Adapted from the THREE.js tutorial to processing by Andres Colubri, | |
# translated to JRubyArt by Martin Prout: | |
# http://learningthreejs.com/blog/2013/09/16/how-to-make-the-earth-in-webgl/ | |
attr_reader :earth, :clouds, :earth_shader, :cloud_shader, :earth_rotation | |
attr_reader :clouds_rotation, :target_angle | |
IMAGES = %w(earthmap1k.jpg earthcloudmap.jpg earthcloudmaptrans.jpg earthbump1k.jpg earthspec1k.jpg).freeze | |
TEXTURES = %i(earth cloud alpha bump spec).freeze |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hype; | |
@FunctionalInterface | |
public interface HCallback { | |
public void run(Object obj); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
load_library :hype | |
include_package 'hype' | |
module Hype | |
java_import 'hype.extended.layout.HGridLayout' | |
java_import 'hype.extended.behavior.HMagneticField' | |
java_import 'hype.extended.behavior.HSwarm' | |
end | |
attr_reader :pool, :pool_swarm, :field, :swarm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Here is an example of a more tricky sketch to convert, first I exported to pure java (none that obfusctating processing | |
* crap), interestingly we can use a jdk8 lambda in place of a anonymous class for callback this is probably one way | |
* forward, although to be honest it may actually pay to create a JRuby extension to get more efficient operation. | |
*/ | |
import processing.core.*; | |
import hype.*; | |
import hype.extended.layout.HGridLayout; | |
import hype.extended.behavior.HMagneticField; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# convert.rb | |
VECLIBR = /\:(vecmath|fastmath)/ | |
sketch = <<CODE | |
require 'propane' | |
class %s < Propane::App | |
%s | |
end |