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
Delivered-To: m4infr4me@gmail.com
Received: by 10.114.71.5 with SMTP id q5csp16278ldu;
Sat, 6 Oct 2012 11:23:12 -0700 (PDT)
Received: by 10.180.87.74 with SMTP id v10mr10532233wiz.21.1349547792331;
Sat, 06 Oct 2012 11:23:12 -0700 (PDT)
Return-Path: <service@paypal.co.uk>
Received: from t8.cs.man.ac.uk (sonoft8.cs.man.ac.uk. [130.88.192.208])
by mx.google.com with ESMTPS id p49si9515602wea.135.2012.10.06.11.23.11
(version=TLSv1/SSLv3 cipher=OTHER);
<?php
/**
* Defines the TFFormField class.
*
* @author Damien Walsh <damien@transcendsolutions.net>
* @copyright Copyright © 2012, Damien Walsh, TranscendSolutions UK
* @package transcendframework
*/
/**
* TFFormField
@themainframe
themainframe / organise.php
Created December 18, 2012 21:30
H.264 DVR backup file bulk-renamer script
<?php
/**
* Organises "ShenZhen" H.264 DVR Rip files into day-folders for easy burning.
* Run interactively with this command:
*
* php organise.php
*
* Example of action:
*
* ./backup01__12142012-14'49'16--12142012-15'01'14.264
@themainframe
themainframe / lmg7401plbc.txt
Last active February 4, 2018 00:50
A description of the LG7401PLBC Display Module.
LMG7401PLBC Display Module
160x60 graphic dot-matrix LCD
Chips:
1 x Hitachi HD61830B Dot Controller
1 x Winbond W24655 Static RAM (SRAM) 1KB
5 x SANYO LC7940N Segment Driver
Schematic:
Mac-Pro:~ damo$ php
<?php
class A {
function __clone() { clone($this); }
}
@themainframe
themainframe / ExprParser.php
Last active December 10, 2015 04:48
Expression parser in PHP.
<?php
/**
* Expression Parser
* Parses infix expressions using Dijkstra's Shunting Yard algorithm.
*
* @author Damien Walsh <me@damow.net>
* @verson 1.0
*/
header('Content-Type: text/plain');
@themainframe
themainframe / events.json
Last active December 10, 2015 06:18
Events listing as both JSON and XML...
{
"events": {
"52": {
"name": "RockDJ",
"description": "blah"
},
"53": {
"name": "Something else",
"description": "lol"
}
@themainframe
themainframe / next_time.php
Created December 30, 2012 02:10
next_time.php
<?php
/**
* Get the UNIX timestamp of the next instance of a time.
*
* @param int $hours The hours.
* @param int $minutes Optionally, the minutes. Default 0.
* @return int
*/
function next_time($hours, $minutes = 0)
@themainframe
themainframe / test.php
Last active December 10, 2015 08:58
Fixed the drift bug.
<?php
/**
* Get the UNIX timestamp of the next instance of a time.
*
* @param int $hours The hours.
* @param int $minutes Optionally, the minutes. Default 0.
* @return int
*/
function next_time($hours, $minutes = 0)
@themainframe
themainframe / gist:4540787
Created January 15, 2013 18:28
Example df output
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk0s2 76224000 73315776 2396224 97% 9228470 299528 97% /
devfs 381 381 0 100% 660 0 100% /dev
/dev/disk1s2 487725344 80875336 406850008 17% 10109415 50856251 17% /Volumes/Data
map -hosts 0 0 0 100% 0 0 100% /net
map auto_home 0 0 0 100% 0 0 100% /home