Skip to content

Instantly share code, notes, and snippets.

var actx = new AudioContext();
var sound = actx.createBufferSource();
var req = new XMLHttpRequest();
var audioFile = 'https://dl.dropboxusercontent.com/u/87705298/136351__djmastah__requiem-3.mp3';
req.open('GET', audioFile, true); req.responseType = 'arraybuffer';
req.onload = function() {
actx.decodeAudioData(req.response, function(buffer) {
sound.buffer = buffer;
jQuery(function($) {
function Demo() {
var i, j;
$('html').css('perspective', '2000px');
$('body').css({'transition': 'transform 0.1s ease-out'});
var mousePos = {};
$(window).mousemove(function(e) {
mousePos.x = e.clientX;
mousePos.y = e.clientY;
});
@MattRoelle
MattRoelle / newwp.sh
Created July 10, 2014 15:14
New WP on localhost
#!/bin/sh
echo "# Downloading latest.tar.gz"
wget wordpress.org/latest.tar.gz
echo "# Extracting"
tar -xf latest.tar.gz
echo "# Cleaning Up"
mv wordpress/* .
rm -r wordpress
echo "# Setting up mysql"
mysql -u root -p -e "create database $1db; grant usage on *.* to $1user@localhost identified by '$2'; grant all privileges on $1db.* to $1user@localhost;"
@MattRoelle
MattRoelle / gist:63b663a80da7cc79fc56
Created June 19, 2014 02:57
wavepot.com is my new addiction, livecoding in javascript
var generated = false;
var currentNote = false;
var bpm = 600;
var sequence = [
squareWave(50, 0.1),
sineWave(440, 0.4),
squareWave(50, 0.1),
sineWave(540, 0.4),
squareWave(50, 0.1),
/*
Geometry Library
All angles are in radian measurements
*/
// Point Object
function Point(x, y) {
if (x.length === undefined) {
this.x = x;
this.y = y;
registerEntity('player', {
poly: [[100, 100], [200, 100], [100, 200]],
init: function(that) {
},
render: function(that) {
ctx.strokeStyle = '#fff';
canvasUtils.drawPolygon(that.poly);
}
});
/*
Geometry Library
All angles are in radian measurements
*/
// Point Object
function Point(x, y) {
this.x = x;
this.y = y;
};
/*
* CSS matrix3d transform API
* Simplification of 3d transforms
* Matt Roelle
* 2013
*
* Dependent on the Sylvester math library (http://sylvester.jcoglan.com/)
*/
function Surface() {
var regexps = [
{
'regexp': /`([^`]*)`/g,
'flag': 'code'
},
{
'regexp': /\*\*([^\*]*)\*\*/g,
'flag': 'bold'
},
{
/*
* CSS matrix3d transform API
* Simplification of 3d transforms
* Matt Roelle
* 2013
*
* Dependent on the Sylvester math library (http://sylvester.jcoglan.com/)
*/
function Surface() {