Skip to content

Instantly share code, notes, and snippets.

View tommycutter's full-sized avatar

Tommy Cutter tommycutter

View GitHub Profile
<?php
$fileName = time().'.mp3';
$fileUrl = $_GET['fileUrl'];
$jsonOutputFile = time().'-normalized.json';
file_put_contents($fileName, file_get_contents($fileUrl));
exec('audiowaveform -i '.$fileName.' -o '.$jsonOutputFile.' --pixels-per-second 20 --bits 8');
sleep(5);
echo file_get_contents($jsonOutputFile);
unlink($fileName);
@tommycutter
tommycutter / LetterSpacing.cs
Created January 20, 2016 14:03
Letter Spacing Component for Unity 5_3
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/*
http://forum.unity3d.com/threads/adjustable-character-spacing-free-script.288277/
Unity 5.1 and 5.2.2+ compatible
Produces an simple tracking/letter-spacing effect on UI Text components.
@tommycutter
tommycutter / PathJS Dynamic Routes
Created March 13, 2013 18:00
Template for dynamic routes with PathJS
Path.map("#/activities(/:param1)(/:param2)").to(function(){
// View all activities
if(!this.params["param1"]) {
activitiesPage();
}
// Create a new activity
if(this.params["param1"] == 'create') {
activitiesCreatePage();