Skip to content

Instantly share code, notes, and snippets.

View fiskurgit's full-sized avatar
🌑
...

öppenteknikstudio fiskurgit

🌑
...
View GitHub Profile
@fiskurgit
fiskurgit / gist:3268993664bdd3555ce0
Created May 15, 2015 08:12
Upload for @awecane - the triangulate library is missing from its original location but this may be the same: http://forum.processing.org/two/discussion/7411/missing-libraries-triangulate
import controlP5.*;
import javax.swing.*;
import org.processing.wiki.triangulate.*;
ArrayList triangles = new ArrayList();
ArrayList points = new ArrayList();
PImage bg;
boolean doDraw = true;
@fiskurgit
fiskurgit / gist:faf756da90be76639604
Created June 12, 2015 10:11
Quick fix for AndroidPreprocessor.java in Processing Android to work with the latest build of Processing.
public String[] initSketchSize(String code) throws SketchException {
SurfaceInfo surfaceInfo = parseSketchSize(code, true);
if (surfaceInfo == null) {
System.err.println("More about the size() command on Android can be");
System.err.println("found here: http://wiki.processing.org/w/Android");
throw new SketchException("Could not parse the size() command.");
}
try{
@fiskurgit
fiskurgit / Superfastblur.pde
Created October 23, 2015 10:01
Updating Mario's Superfast gaussian approximation to work with Processing 3.0, just needed updatePixels(); adding
// Super Fast Blur v1.1
// by Mario Klingemann <http://incubator.quasimondo.com>
//
// Tip: Multiple invovations of this filter with a small
// radius will approximate a gaussian blur quite well.
//
// Updated 23/10/2015 to work with Processing 3.0
//
PImage source;
@fiskurgit
fiskurgit / Stars.pde
Last active October 26, 2015 17:21
Create a random background image to represent a sky full of stars
PImage stars;
void setup() {
size(700, 400, P3D);
populateStarBackground();
}
void populateStarBackground(){
/**
* Corona code adapted from the Topics/Geometry/Noise Sphere example by David Pena.
* Planets orbiting code is by Adam Schmidt: http://www.openprocessing.org/sketch/8813
* Comets from Ignivome, inspired by Flight404's work: http://www.openprocessing.org/sketch/40052
*/
final int MAX_OPACITY = 140;
final int MAX_TAIL_AREA = 200;
//The background image
//Moirè patterns
final int BATCH_SIZE = 15;
int diameter = 1;
void setup(){
size(600, 400, P3D);
noFill();
frameRate(15);
}
//Ripple
final int NUM_RIPPLES = 160;
final int MAX_OPACITY = 120;
float diameter = 1;
ARipple[] ripples;
float bobbleOffset = 0.0;
float inc = TWO_PI/20;
public class RemedialStringType {
String label = null;
String[] labelArray = null;
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
public class SomeObject {
//This field can be either a string or string[]
RemedialStringType label;
public RemedialStringType getLabel() {
return label;
}
public void setLabel(RemedialStringType label) {
RestAdapter.Builder builder = new RestAdapter.Builder();
Gson gson = new GsonBuilder().registerTypeAdapter(RemedialStringType.class, new RemedialStringTypeAdapter()).create();
builder.setConverter(new GsonConverter(gson));
builder.setEndpoint(BASE_URL);
rest = builder.build().create(SomeServiceRest.class);