Skip to content

Instantly share code, notes, and snippets.

View ArcticLight's full-sized avatar
🍎

Matthew Clive ArcticLight

🍎
View GitHub Profile
@ArcticLight
ArcticLight / BecauseWhyNotParticleEffects.pde
Created February 19, 2014 21:22
Because Why Not Particle Effects?
abstract class Shape {
PVector p,v,g;
float r,rv;
int radius;
color fc, sc;
public Shape() {
this.fc = color((int)random(0,256),(int)random(0,256),(int)random(0,256),(int)random(0,256));
this.sc = color((int)random(0,256),(int)random(0,256),(int)random(0,256),(int)random(100,256));
//this.p = new PVector(width/2 + random(-width/8,width/8), height/2 + random(-height/8,height/8));
@ArcticLight
ArcticLight / pwidget.pde
Created February 19, 2014 22:14
Percentage Widgets
void fancyCirclePercentWidget(int percent) {
float p = percent/50.;
pushMatrix();
translate(50,50);
rotate(radians(270));
ellipseMode(CENTER);
stroke(0);
strokeWeight(1);
noFill();
ellipse(0,0,30,30);
@ArcticLight
ArcticLight / keybase.md
Last active August 29, 2015 13:57
Keybase Verification

Keybase proof

I hereby claim:

  • I am ArcticLight on github.
  • I am arcticlight (https://keybase.io/arcticlight) on keybase.
  • I have a public key whose fingerprint is 0EA9 26B3 C776 0F6D 3F12 31ED B2E8 F0E4 2D56 473F

To claim this, I am signing this object:

@ArcticLight
ArcticLight / seceiver.py
Created April 28, 2014 03:07
Receiver and Sender py
# chat server using multicast
# python fork of the original ruby implementation
# http://tx.pignata.com/2012/11/multicast-in-ruby-building-a-peer-to-peer-chat-system.html
# receiver.py
# usage : $ python receiver.py # wait for messages to come in
import socket
import struct
multicast_addr = '224.0.0.1'
@ArcticLight
ArcticLight / engrish.md
Created August 10, 2014 18:04
engrish

Engrish

Imagine a world where everything was written in simple statements that a four year old could understand. Obviously, this is not the world we live in, but try to imagine it. What if you could come up with a gently structured syntax using all English keywords that read like a terrible preschool-level book, but could then be machine parsed to produce useful insight and knowledge? What if this graph could then be traversed and matched in order to produce new facts and insight, then queried like a database? This is Engrish.

@ArcticLight
ArcticLight / ClobberTable.java
Last active August 29, 2015 14:07
ClobberTable for Syntax Tables
class ClobberTable<K, T> {
ClobberTable parent;
HashTable<K, T> my;
ArrayList<K> whites;
public ClobberTable() {
parent = null;
my = new HashTable<K, T>();
whites = new ArrayList<K>();
}
@ArcticLight
ArcticLight / Main.java
Created October 25, 2014 02:37
Thread safety in Java
import java.util.ArrayList;
public class Main {
/***************************************
* First, here's the complete code for an example that doesn't work.
* This is necessary so you can look at it and compare it with the
* patches we make so it *does* work.
***************************************/
@ArcticLight
ArcticLight / USL.scala
Last active August 29, 2015 14:08
USL
/**
* USL - Useless Stack Language
*/
import scala.collection.mutable
object USL {
/********************
* Handling USL Data
********************/
@ArcticLight
ArcticLight / segfaultClock
Created February 18, 2015 02:32
Wat the segfault
int lastS;
float munge;
void setup() {
size(300,300);
lastS = second();
munge = 0;
}
void draw() {
@ArcticLight
ArcticLight / frob.js
Last active August 29, 2015 14:20
CSS Animations + Javascript = Hell
// This is a snippet that may or may not eventually make it live to my wobsite.
// This is the shortest code I currently know how to write that triggers my
// in/out animations correctly on toggle - every time - in the browser.
// The "Every Time" bit is the hardest bit.
function toggleReq() {
requirementsOpen = !requirementsOpen;
if(requirementsOpen) {
req.style.height=document.getElementById("reqcontent").offsetHeight+8+"px";