Skip to content

Instantly share code, notes, and snippets.

View anselm's full-sized avatar

anselm anselm

View GitHub Profile
@anselm
anselm / ConwayArduinoColor
Created December 31, 2014 02:55
A pile of hack code to play around with a version of conways life to play on a 16x16 ws2812b led panel using an arduino. Also some perlin noise code.
// A pile of hack code to play around with a version of conways life to play on a 16x16 ws2812b led panel using an arduino
// also some playing around perlin noise
/////////////////////////////////////////////////////////////////////////////////////////////
#include <math.h>
@anselm
anselm / Unity3DArrow
Created October 7, 2014 23:22
An example of having a 2d arrow on the screen follow a 3d object in the world as a kind of radar hint about where that object is (for Unity3D).
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class ArrowScript : MonoBehaviour {
public GameObject lookat;
public Camera camera;
public const float EDGE = 0.3f;
public const float DIST = 100;
@anselm
anselm / TCP_Client_Server_
Created June 20, 2014 18:08
C# TCP Client Server TcpListener NetworkStream UDP
/*
Some scratch code for testing a variety of patterns of client server connection.
I needed to send data from an android phone to a macbook via USB and I happened to be using C# under Unity 3D. Some of the problems I ran into included:
- co-routines under unity were not fully exhausting the tcp buffers fast enough i think; even when I aggressively polled until they were empty...
- kept running into a curious bug where when the android device overheated that there would be a huge latency in traffic from the android device to the desktop.
@anselm
anselm / gist:6818713
Created October 3, 2013 23:31
Playing with the Goertzel algorithm... Replace the libcinder AudioInputSample main app .cpp with this... and throw in https://github.com/mpenkov/dtmf-cpp/blob/master/detect-au.cpp
#include "cinder/Cinder.h"
#if defined( CINDER_COCOA_TOUCH )
#include "cinder/app/AppCocoaTouch.h"
typedef ci::app::AppCocoaTouch AppBase;
#else
#include "cinder/app/AppBasic.h"
#include "cinder/audio/FftProcessor.h"
typedef ci::app::AppBasic AppBase;
#endif
@anselm
anselm / openglribbon.java
Created December 13, 2011 22:17
A snippet of code to draw opengl ribbons given a series of connected line segments
// Note that I wrote this in java in Processing - paste this GIST into processing to see it in action.
// It is not the most elegant thing ever but it does deal with end caps and ribbon loops and the like.
// If you port this over to say objective-c / opengl / c etc - you may need to deal with polygon direction
// here is a snapshot of it running : http://www.flickr.com/photos/anselmhook/6507471719/in/photostream
int nvertices = 0;
float[] vertexpool = new float[3000];
float x1,x2,y1,y2;
void intersect(int kind, float x0, float y0, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4) {
This file has been truncated, but you can view the full file.
[111th CONGRESS Senate Bills]
[From the U.S. Government Printing Office via GPO Access]
[DOCID: s22pcs.txt]
[Placed on Calendar Senate]
Calendar No. 13