Skip to content

Instantly share code, notes, and snippets.

View themainframe's full-sized avatar
🕶️
Hacking the Gibson

Damo themainframe

🕶️
Hacking the Gibson
View GitHub Profile
@themainframe
themainframe / fb.php
Last active May 6, 2018 11:26
Facebook message extractor
<?php
/**
* Extract the messages from that awful HTML file Facebook gives you when
* you request an archive of your data.
*
* Writes them to a database.
*
* @author Damien Walsh <me@damow.net>
* @license MIT
*/
### Keybase proof
I hereby claim:
* I am themainframe on github.
* I am fel (https://keybase.io/fel) on keybase.
* I have a public key whose fingerprint is D385 4112 D034 D00B B907 26A9 A349 CD26 50D6 26CC
To claim this, I am signing this object:
@themainframe
themainframe / boolval.c
Created October 25, 2013 13:37
PHP Boolval
/* {{{ proto bool boolval(mixed var)
Get the boolean value of a variable */
PHP_FUNCTION(boolval)
{
zval **val;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Z", &val) == FAILURE) {
return;
}
@themainframe
themainframe / ricktext.php
Created October 25, 2013 08:25
Ricktext circa 2008-2009?
<?php
/**
* RickText
* Reads FLV movies/Folders of Images, outputs ASCII art animated with JS.
*
* @author Damien Walsh <me@damow.net>
* @version 1.0
*/
class RickText
{
@themainframe
themainframe / fix_casted_array.php
Last active December 23, 2015 09:48
Fix a casted array from an object.
<?php
function fix_array($bad)
{
foreach($bad as $k => $v)
$new[$k] = is_array($v) ? fix_array($v) : $v;
return $new;
}
@themainframe
themainframe / key-fails.php
Last active December 23, 2015 09:39
Strange things happen in PHP...
<?php
// Create a new stdClass generic object
$obj = new stdClass;
// Assign the property '1' to be a string 'foo'
$obj->{'1'} = 'foo';
// Cast the object into an array, turning properties into keys
$arr = (array)$obj;
@themainframe
themainframe / gist:6545371
Created September 12, 2013 23:58
Voicemail check
-- Executing [9000@default:1] VoiceMailMain("SIP/101-00000003", "") in new stack
-- <SIP/101-00000003> Playing 'vm-login.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-password.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-youhave.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'digits/1.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-INBOX.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-message.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-onefor.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-INBOX.gsm' (language 'en')
-- <SIP/101-00000003> Playing 'vm-messages.gsm' (language 'en')
@themainframe
themainframe / ca2play.php
Created June 12, 2013 23:05
ChannelAdvisor to Play.com Image Formatter
<?php
/**
* Converts ChannelAdvisor style image URL meshes to Play.com style
* image spreadsheets.
*
* @author Damien Walsh <me@damow.net>
* @version 1.0
*/
// ------------------------------------------------------
@themainframe
themainframe / arduino-irip.cpp
Created June 1, 2013 01:28
IR over IP project.
//
// Includes
//
#include <IRremote.h>
#include <SPI.h>
#include <Ethernet.h>
//
// Globals
//
~ » traceroute -i en0 facebook.com
traceroute to facebook.com (173.252.110.27), 64 hops max, 52 byte packets
1 10.34.176.1 (10.34.176.1) 7.419 ms 7.646 ms 8.039 ms
2 * * *
^C
~ » traceroute -i utun1 facebook.com
traceroute to facebook.com (173.252.110.27), 64 hops max, 52 byte packets
1 130.88.250.162 (130.88.250.162) 22.282 ms 48.733 ms 21.228 ms
2 gw-rh (130.88.250.10) 21.728 ms 21.791 ms 22.249 ms
3 gw-uom-rh (130.88.250.78) 21.602 ms 21.620 ms 22.228 ms