Skip to content

Instantly share code, notes, and snippets.

import org.philhosoft.p8g.svg.P8gGraphicsSVG;
float r = 0;
void setup()
{
size(1000, 1000);
noLoop(); // No animation
// Start the recording
@jellea
jellea / styles.clj
Last active November 5, 2015 22:22
EDNCSS; A small library for easy styling in React Native in combination with Clojurescript. Loosely based on Basscss, excluding functions not supported by RN. Would be super useful in combination with hiccup's .style classnames, will write a wrapper for this. Might also make this js compatible. Still incomplete!
(ns edncss)
(def colours {"transparent" "transparent"
"black" "#222"
"green" "#3DF2AC"
"blue" "#147DEF"})
;; TODO more colours
(def base 5)
// Simplest possible wrapper around IHKeyboardAvoiding.
//
// I don't really know how to Xcode, but I got it to work by:
//
// 1. Checking out the IHKeyboardAvoiding repository.
// https://github.com/IdleHandsApps/IHKeyboardAvoiding
//
// 2. Dragging the Files IHKeyboardAvoiding.{h,m} into my project.
//
// 3. Ensuring that both .m files are in the "Compile Sources" phase of the target.
@jellea
jellea / parse.cljs
Last active November 23, 2015 16:48
(def game-score (js/Parse.Object.extend "GameScore"))
(def query (Query. js/Parse game-score))
(.get query "xWMyZ4YEGZ" #js {:success (fn [result] (prn result))
:error #(prn %2)})

Quil Cheatsheet

Shapes -- (these only work in the draw function!)

(line x1 y1 x2 y2)
Draws a line (a direct path between two points) to the screen. x1, y1, x2 and y3 are all numbers which are being used as coordinates, or pixels from the top left on your screen.

(rect x y width height)
Draws a rectangle to the screen. x and y are coordinates. Width and height are how big the box is, again in numbers.

@jellea
jellea / 1-protocols.cljs
Last active February 3, 2016 10:54
Minimal Redux implementation in clojurescript. Two versions.
(def initial-state {:counter 0})
(defonce !state (r/atom initial-state))
(defonce !actions (atom []))
(defprotocol Action
(reducer [action state]))
(defn dispatch! [action]
@jellea
jellea / keybase.md
Last active February 5, 2016 16:35

Keybase proof

I hereby claim:

  • I am jellea on github.
  • I am jelle (https://keybase.io/jelle) on keybase.
  • I have a public key ASAxoAkXEHFrdx4IzDC-DAO5Tcx3-asO-HhIT5pwLzTPtgo

To claim this, I am signing this object:

@jellea
jellea / ofApp.cpp
Created May 21, 2016 15:37
Small testing env with MLP (GRT) and Openframeworks
#include "ofApp.h"
bool learning = false;
bool training = false;
bool running = false;
int selectedClass = 1;
int numInputs = 6;
@jellea
jellea / init.lua
Created June 6, 2016 07:58
Nodemcu connecting with max113300
pin = 8;
gpio.mode(pin,gpio.OUTPUT);
gpio.write(pin,gpio.HIGH);
spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, spi.DATABITS_8, 0,spi.FULLDUPLEX);
gpio.write(pin,gpio.LOW);
function readRegister(address)
gpio.write(pin,gpio.HIGH);
gpio.write(pin,gpio.LOW);
spi.send(1, bit.lshift(0x01, address));
// inslude the SPI library:
#include <SPI.h>
#include "Pixi.h" // dependency: https://github.com/wolfgangfriedrich/Pixi_demo
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <WiFiUdp.h>
#include <OSCMessage.h> // dependency: https://github.com/CNMAT/OSC
#include <OSCBundle.h>
#include <OSCData.h>