Skip to content

Instantly share code, notes, and snippets.

@haydenjameslee
haydenjameslee / CoherentWebAudioPlayer.cs
Created January 19, 2016 00:07
Gets PCM audio data from a CoherentUI browser in Unity3D and plays it through a Unity audio filter.
using UnityEngine;
using System.Collections;
using Coherent.UI;
using System.IO;
using System;
using System.Runtime.InteropServices;
[RequireComponent(typeof(CoherentUIView))]
[RequireComponent(typeof(AudioSource))]
unsafe public class CoherentAudioPlayerFilter : MonoBehaviour
@gouldingken
gouldingken / Readme.md
Last active August 6, 2020 06:27
square pack to fill any SVG shape
@gouldingken
gouldingken / Readme.md
Last active January 12, 2023 19:03
circle pack to fill any SVG shape
@mrexcessive
mrexcessive / gist:1c22b23f04f9a3217d44
Last active April 26, 2022 08:11
Tupper Everything formulae in Python tested using .png created from GIMP. Expects no spaces in input data.
#!/usr/bin/python
#@mrexcessive
#this is based on java code from
# https://bitbucket.org/BJRowlett2/tuppers-formula/src/52fcf0b0ee94853e293a6f33e71ccd0c45a6e752/source/Tuppers.java?at=master
import sys,os
from PIL import Image
def GetNextFileName(fnamebase):
@going-digital
going-digital / fast_trig.frag
Created December 17, 2012 17:21
OpenGL ES Fast sin/cos functions. Double the speed of native on Raspberry Pi / Videocore IV
// Language is OpenGL ES, but gist.github.com doesn't know that language
//
// Approximation is based on multiply/accumulate, because thats the only
// thing Videocore can do quickly!
precision highp float;
float sinf(float x)
{
x*=0.159155;
@mckamey
mckamey / bezier.js
Created September 25, 2012 16:35
JavaScript port of Webkit CSS cubic-bezier(p1x.p1y,p2x,p2y) and various approximations
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the