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 | |
/** | |
* Trait Lazy | |
* | |
* Allows for lazy initialization of object and class values. | |
* | |
* Example: | |
* | |
* class Test { |
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 | |
/** | |
* | |
* Helper Class to output correct Twitter Bootstrap Markup. | |
* Only option for now is the horizontal Form. | |
* | |
* Usage : | |
* | |
$form = new BootstrapForm('add_user'); | |
$form->addInput('text-input', 'user_name', 'Your name:', true); |
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
<!-- http://twitter.github.io/typeahead.js/data/repos.json --> | |
<input type="text" autocomplete="off" class="form-control" | |
id="client-search" | |
data-typeahead-url="./repos.json" | |
data-typeahead-target="client-id"> | |
<input type="hidden" id="client-id" name="client-id"> |
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 -q | |
<?php | |
/** | |
* Returns tab-delimited latitude,longitude,formatted address for given address from Google Maps API | |
* @author Warren Stevens (warbaby67@gmail.com) | |
**/ | |
$base = 'http://maps.googleapis.com/maps/api/geocode/json?'; |
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 it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);} |
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 base58 | |
{ | |
static public $alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"; | |
public static function encode($int) { | |
$base58_string = ""; | |
$base = strlen(self::$alphabet); | |
while($int >= $base) { |
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
/** | |
for( $a=1; $a<20; $a++ ) { | |
echo '----------------------' . PHP_EOL; | |
echo 'PROJECT_ID :: ' . $a . PHP_EOL; | |
$last = $c[ 'predis' ]->get( 'round-robin-dispatch' ); | |
$i = $j = -1; | |
$n = count( $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 | |
//DOM Templating classes v7 © copyright (cc-by) Kroc Camen 2012 | |
//you may do whatever you want with this code as long as you give credit | |
//documentation at http://camendesign.com/dom_templating | |
class DOMTemplate extends DOMTemplateNode { | |
private $DOMDocument; | |
private $keep_prolog = false; | |
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 | |
namespace Controller; | |
class HomeController | |
{ | |
public function getAction($app) | |
{ | |
return 'Hello!'; | |
} |
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 | |
/** | |
* A simple Facebook PHP example. | |
* | |
* - This is not a "Facebook SDK". | |
* - This example uses Curl, Hash, JSON, Session extensions. | |
* - This does not use the JavaScript SDK, nor the cookie set by it. | |
* - This works with Canvas, Page Tabs with IFrames, the Registration Plugin | |
* and with any other flow which uses the signed_request. |
OlderNewer