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/php | |
<?php | |
if (! isset($argv[1])) { | |
fputs(STDERR, "Please provide a URL to crawl\n"); | |
die(1); | |
} | |
if (! isset($argv[2])) { | |
fputs(STDERR, "Please provide an output filename\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/php | |
<?php | |
$yscale = 11; | |
$xscale = 5; | |
$target_width = get_tty_width(); | |
$inverted = false; | |
$flags = Array(); | |
$flag_parameters = Array(); |
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/php | |
<?php | |
class ColorCLI { | |
static $foreground_colors = array( | |
'black' => '0;30', 'dark_gray' => '1;30', | |
'blue' => '0;34', 'light_blue' => '1;34', | |
'green' => '0;32', 'light_green' => '1;32', |
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 | |
class Stream { | |
private static $stdin_handle = false; | |
private static $stdout_handle = false; | |
static function in() { | |
if (self::$stdin_handle === false && PHP_SAPI === 'cli') { | |
self::$stdin_handle = fopen("php://stdin", "r"); |
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 | |
class CN_Page { | |
private $page_regions = Array(); | |
private $page_region_data = Array(); | |
private $page_region_count = Array(); | |
const dynamic_key = 'dynamic'; | |
const html_key = 'html'; |
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 | |
/** | |
* Wrapper class for database access | |
* | |
* Simple database wrapper. While it handles some | |
* stuff pretty okay at the moment. The big draws are the | |
* update_records, insert_record, insert_records, get_records, | |
* and get_record. Other than that, it can also wrap query calls, etc. | |
* |
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 array_map_r($callback, $input) { | |
$output= Array(); | |
foreach ($input as $key => $data) { | |
if (is_array($data)) { | |
$output[$key] = array_map_r($callback, $data); | |
} else { | |
$output[$key] = $callback($data); | |
} | |
} | |
return $output; |
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 | |
error_reporting(E_ALL); | |
function getExtension($filename, &$base = NULL) { | |
$a = split('\.', $filename); | |
$ext = array_pop($a); | |
$base = join('.', $a); | |
return strtolower($ext); | |
} |
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 get_params($url) { | |
$param_regex = "/[\?\&]{1}([^=]+)(\=([^\&\=]*))?/"; | |
preg_match_all($param_regex, $url, $matches); | |
$params = Array(); | |
foreach ($matches[1] as $index => $key) { | |
$params[$key] = ($matches[2][$index]?$matches[3][$index]:null); | |
} | |
return $params; | |
} |
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($) { | |
$.fn.lameroll = function(data) { | |
this.prefs = $.extend($.fn.lameroll.defaults, data); | |
this.css({ | |
"width":this.prefs.width, | |
"height":this.prefs.height, | |
"list-style-type":"none", | |
"display":"block", |