Skip to content

Instantly share code, notes, and snippets.

@alecgorge
alecgorge / fb phonenumbers.js
Created December 4, 2010 19:33
Gets the phone numbers of your Facebook friends and gives CSV and JSON output.
/**
* Run this script in the console on http://www.facebook.com/friends/edit/?sk=phonebook
*/
(function () {
function getScript(url, success) {
var script = document.createElement('script');
script.src = url;
var head = document.getElementsByTagName('head')[0],
done = false;
script.onload = script.onreadystatechange = function () {
@alecgorge
alecgorge / Attribute Class.php
Created November 17, 2010 03:25
How I think attributes should go down.
<?php
class WebService extends Attribute {
public $baseURI = "";
public $name = "";
public $desc = "";
public function __construct ($baseURI, $name, $desc) {
$this->baseURI = $baseURI;
$this->name = $name;
function range ( low, high, step ) {
// http://kevin.vanzonneveld.net
// + original by: Waldo Malqui Silva
// * example 1: range ( 0, 12 );
// * returns 1: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
// * example 2: range( 0, 100, 10 );
// * returns 2: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
// * example 3: range( 'a', 'i' );
// * returns 3: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']
// * example 4: range( 'c', 'a' );
function num_exchange ($int) {
$arr = array('W','x','J','y','5','v','l','0','R','M');
return $arr[$int];
}
function num_rev_exchange ($let) {
$arr = array('W','x','J','y','5','v','l','0','R','M');
return array_search($let, $arr);
}
function rand_char_for_n ($n) {
while($c <= $n) {
<pre><?php
function array_insert($array,$pos,$val) {
$array2 = array_splice($array,$pos);
$array[] = $val;
$array = array_merge($array,$array2);
return $array;
}
function calcMostCommonDiff($orig, $files) {
$mismatches = array();
$inRow = 0;
$firstLength = strlen(reset($orig));
$firstFile = reset($orig);
foreach($files as $file) {
$inRow = 0;
for($i = 0; $i < $firstLength; $i++) {
ld: warning: in /usr/lib/haxe/lib/nme/1,0,2/ndll/iPhone/libNME.iphoneos.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/alec/Documents/haxe/static-sdl/sdl-static-read-only/libfreetype.iphoneos.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/alec/Documents/haxe/static-sdl/sdl-static-read-only/libjpeg.iphoneos.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/alec/Documents/haxe/static-sdl/sdl-static-read-only/libogg.iphoneos.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/alec/Documents/haxe/static-sdl/sdl-static-read-only/libpng.iphoneos.a, file was built for unsupported file format which is not the architecture being linked (i386)
ld: warning: in /Users/alec/Documents/haxe/static-sdl/sdl-static-read-only/libSDL.iphoneos.a, file was