This file contains hidden or 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 | |
/** | |
* Generic SPL class loader | |
* @license http://opensource.org/licenses/mit-license.php MIT License | |
* @author Lachlan Donald <[email protected]> | |
*/ | |
class ClassLoader | |
{ | |
private $_paths = array(); |
This file contains hidden or 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 php | |
<?php | |
## git-recent-branches: shows all branches, sorted by the most recently updated | |
## git-recent-branches Copyright 2009 Lachlan Donald <[email protected]>. | |
$verbose = in_array('-v',$argv); | |
$arg = in_array('-a',$argv) ? '-a' : ''; | |
$branches = array(); |
This file contains hidden or 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
// Lox's Quake3 Config | |
// copy into the baseq3 directory to use | |
seta r_customHeight "900" | |
seta r_customWidth "1440" | |
seta r_mode "-1" | |
seta cg_fov 120 | |
seta r_detailtextures "1" | |
seta r_drawSun "1" |
This file contains hidden or 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
1) extract tracks from the mkv file | |
mkvextract tracks <source_file.mkv> 1: <source_file.h264> 2:<source_file.ac3> | |
2) convert video to be compliant with the ATV | |
ffmpeg -y -i <source_file.h264> -vcodec libx264 -b <bitrate> -maxrate <max_bitrate> -an -threads 4 -level 31 -g 250 -qmin 10 -qmax 51 -qdiff 4 -subq 6 -flags +loop -flags2 +mixed_refs+wpred -sc_threshold 40 -partitions +parti4x4+partp8x8+partb8x8 -refs 4 -bf 16 -keyint_min 25 -me_method umh -me_range 16 -i_qfactor 0.71 -cmp +chroma -b_strategy 1 -qcomp 0.6 -trellis 0 -rc_eq 'blurCplx^(1-qComp)' -f h264 <dest_file.h264> | |
3) convert audio to aac | |
ffmpeg -y -i <source_file.ac3> -vn -acodec libfaac -ab 160k -ar 48000 -ac 2 -async 50 -threads 4 -f aac <dest_file.aac> | |
4) join all the tracks together |
This file contains hidden or 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 php | |
<?php | |
/** | |
* Command-line script for manipulating timestamps | |
*/ | |
// parse options | |
$options = array('f'=>'r', 't'=>@date_default_timezone_get()); | |
foreach(array_keys($options) as $arg) |
This file contains hidden or 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 | |
/** | |
* A domain object using Pheasant for persistence | |
*/ | |
class User extends DomainObject | |
{ | |
public function __construct($firstname, $lastname) | |
{ |
This file contains hidden or 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 | |
// call looks like this: | |
sendgrid_send(array( | |
'from'=>'[email protected]', | |
'fromname'=>'JustAskTom.com', | |
'to'=>'[email protected]', | |
'subject'=>'Blargh.', | |
'text'=>'test', |
This file contains hidden or 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
#!/bin/sh | |
# | |
# scribed Start and Stop the scribe daemon | |
# | |
### BEGIN INIT INFO | |
# Provides: scribed | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
This file contains hidden or 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
#!/bin/bash | |
# This is the process for installing Thrift, Scribed and the php extension on Ubuntu | |
# [email protected] | |
set -e | |
# install dependancies | |
aptitude install libboost1.40-dev libboost-filesystem1.40-dev libevent-dev build-essential flex bison libtool libevent-dev php5-dev pkg-config | |
# install thrift from source | |
cd /usr/local/src |
This file contains hidden or 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
## A varnish vcl file for WordPress, serves cached pages to not-logged in users | |
director apps random { | |
{ .backend = { .host = "127.0.0.1"; .port = "http"; } .weight = 1; } | |
} | |
acl purge { | |
"localhost"; | |
} |
OlderNewer