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 | |
require_once('/lime/lime.php'); | |
$t = new lime_test(1); | |
$arr = array('foo'); | |
$t->isa_ok($arr, 'array', 'is an 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
<?php | |
if(!class_exists('Db')) | |
require_once( dirname(__FILE__) . '/Db.class.php'); | |
class BastardFinder | |
{ | |
public $mysql, $mongo, $BastardBars, $BastardFoos; | |
static private $instance; |
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 | |
/* Tiny MVC, v.1.0. | |
Author: James Tarleton | |
System Requirements: | |
* PHP 5+ | |
* Web server (Optional) | |
* PDO_MYSQL driver for PHP (Optional) |
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 | |
require_once(dirname(__FILE__).'/model/DATABASE.class.php'); | |
$adid = DATABASE::PDOCreate('mysql://root:123@localhost/db1'); | |
$tablename = 'myawesometable'; | |
$adid->exec(sprintf('DELETE from %s', $tablename)); |
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 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', | |
'cyan' => '0;36', 'light_cyan' => '1;36', | |
'red' => '0;31', 'light_red' => '1;31', |
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 | |
$dh = opendir('.'); | |
while (false !== ($filename = readdir($dh))) | |
{ | |
$files[] = $filename; | |
} | |
sort($files); | |
foreach( $files as $file) | |
{ | |
if( |
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
/* | |
* Super Unique | |
*/ | |
public function super_unique(array $badarray) | |
{ | |
$goodarray = array(); | |
foreach( $badarray as $ba ) | |
{ |
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 | |
/** | |
* | |
* | |
* Factory to create database connections based on URI | |
* | |
* URI: dbtype://user:password@server/database | |
* | |
* |
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 | |
function paginated_links( $totalRecs , $pageSize = 1000, $k=8) | |
{ | |
$numPages = $totalRecs / $pageSize ; | |
$numPages = intval( $numPages ); |
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
<script type="text/javascript"> | |
jQuery(document).ready(function(){ | |
jQuery('#clickme').bind('click', function(){ | |
var q = random(); | |
jQuery('.imgframe').hide(); | |
jQuery('.imgframe').css('background-image', "url('mainpic"+ q +".jpg')" ); |
OlderNewer