Skip to content

Instantly share code, notes, and snippets.

View ansonparker's full-sized avatar

Anson Parker ansonparker

View GitHub Profile
// generate two points on unit square and return true if lte radius
function within(radius)
{
const rand_one = toVector(Math.random()*4)
const rand_two = toVector(Math.random()*4)
return dist(rand_one,rand_two) <= radius
}
@ansonparker
ansonparker / gist:1228449
Created September 20, 2011 05:48
Lossless FLV to MP4 conversion
Open command prompt (Terminal) and run:
ffmpeg -i "filename.flv" -vcodec copy -acodec copy "filename.mp4"
This will copy video track and audio track from filename.flv to filename.mp4. The operation is lossless (there is no quality loss).
@ansonparker
ansonparker / html5_template.html
Last active September 27, 2015 05:48
Super-simple HTML template
<!DOCTYPE html>
<html lang="en">
<head>
<title> _title_ </title>
<meta charset="utf-8" />
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>