Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
<?php | |
/* Basic scraping demo with "find-replace" parsing | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
$url = "http://www.bbc.co.uk/news/"; // 0. url to start with | |
$contents = file_get_contents($url); // 1. get contents of page in a string | |
// 2. search and replace contents |
<?php | |
/* Advanced scraping demo with "regex" parsing. Retrieves current | |
* weather in any city and colors the background accordingly. | |
* The math below for normalization could use some work. | |
* Owen Mundy Copyright 2011 GNU/GPL */ | |
?> | |
<html> |
easterEgg.BadWorder.list={ | |
"4r5e":1, | |
"5h1t":1, | |
"5hit":1, | |
a55:1, | |
anal:1, | |
anus:1, | |
ar5e:1, | |
arrse:1, | |
arse:1, |
// Hello World file for Processing or Processing.js | |
void setup(){ | |
size(1000,700); | |
background(255); | |
} | |
void draw(){ | |
stroke(random(255),random(255), random(255)); | |
line(random(width),random(height), random(width),random(height)); | |
println("Hello World!"); | |
} |
/* | |
You'll need something like this in your HTML: | |
<script src="http://d3js.org/topojson.v1.min.js"></script> | |
*/ | |
L.TopoJSON = L.GeoJSON.extend({ | |
addData: function(jsonData) { | |
if (jsonData.type === "Topology") { | |
for (key in jsonData.objects) { | |
geojson = topojson.feature(jsonData, jsonData.objects[key]); |
Secure sessions are easy, but not very well documented. | |
Here's a recipe for secure sessions in Node.js when NginX is used as an SSL proxy: | |
The desired configuration for using NginX as an SSL proxy is to offload SSL processing | |
and to put a hardened web server in front of your Node.js application, like: | |
[NODE.JS APP] <- HTTP -> [NginX] <- HTTPS -> [PUBLIC INTERNET] <-> [CLIENT] | |
Edit for express 4.X and >: Express no longer uses Connect as its middleware framework, it implements its own now. |
import pyaudio | |
import wave | |
FORMAT = pyaudio.paInt16 | |
CHANNELS = 2 | |
RATE = 44100 | |
CHUNK = 1024 | |
RECORD_SECONDS = 5 | |
WAVE_OUTPUT_FILENAME = "file.wav" | |
//** In web app **// | |
var current = constants.STATE_WAITING; |
using UnityEngine; | |
using System.Collections; | |
public class Metronome : MonoBehaviour | |
{ | |
public double bpm = 140.0F; | |
double nextTick = 0.0F; // The next tick in dspTime | |
double sampleRate = 0.0F; | |
bool ticked = false; |