Skip to content

Instantly share code, notes, and snippets.

View sunekaae's full-sized avatar

Sune Kaae sunekaae

  • Stockholm, Sweden
View GitHub Profile
@sunekaae
sunekaae / processing_http_json
Last active August 29, 2015 14:19
Processing calls an API, parses a a JSON value from the response and shows it on screen.Extend with a) have it call your spark-core to get relevant data value, and b) based on the value decide what sound to play
import http.requests.*;
// Sune for Hyper Hardware
// install the "HTTP Requests" library: "Sketc" > "Import Library" > "Add Library" and type "HTTP Requests".
// https://github.com/runemadsen/HTTP-Requests-for-Processing
int timer;
void setup() {
}
@sunekaae
sunekaae / 0_reuse_code.js
Last active August 29, 2015 14:18
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# This is the same regex/phrasing as the original step from the compendium
# It's just passes on the work to a method which can be used via code from other code
Then /^I save a screenshot with prefix (\w+)$/ do |prefix|
screenshotFromPrefix(prefix)
end
def screenshotFromPrefix prefix
# contruct filename based on the prefix and a timestamp (in millis to avoid overwriting screenshots taken close to each other)
filenameWithRelativePath = "#{prefix}_#{DateTime.now.strftime('%Q')}.png"