This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Convert a phrase to a SEO friendly uri (slug). | |
* | |
* @param string $title Phrase to convert | |
* @param string $separator Word separator | |
* @param boolean $ascii_only Transliterate to ASCII? | |
* @return string | |
*/ | |
function make_slug($title, $separator = '-', $ascii_only = true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Pluck( ctx ) { | |
this.sr = ctx.sampleRate; | |
this.pro = ctx.createScriptProcessor( 512, 0, 1 ); | |
this.pro.connect( ctx.destination ); | |
} | |
Pluck.prototype.play = function( freq ) { | |
var N = Math.round( this.sr / freq ), | |
impulse = this.sr / 1000, | |
y = new Float32Array( N ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Does some fancy stuff | |
Usage: | |
{proc} [-h | --help] | |
{proc} [-v ...] INPUT OUTPUT | |
Options: | |
-h, --help Shows this help |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some possible implementations of the Bresenham Algorithms in C. | |
The Bresenham line algorithm is an algorithm which determines which points in an | |
n-dimensional raster should be plotted in order to form a close approximation | |
to a straight line between two given points. | |
It is commonly used to draw lines on a computer screen, as it uses only integer | |
addition, subtraction and bit shifting, all of which are very cheap operations | |
in standard computer architectures. | |
It is one of the earliest algorithms developed in the field of computer graphics. | |
A minor extension to the original algorithm also deals with drawing circles. |