Skip to content

Instantly share code, notes, and snippets.

David Pennington Xeoncross

Block or report user

Report or block Xeoncross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Lazy.php
<?php
/**
* Trait Lazy
*
* Allows for lazy initialization of object and class values.
*
* Example:
*
* class Test {
View BootstrapForm.php
<?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);
@Xeoncross
Xeoncross / typeahead.usage.html
Created Feb 17, 2014
twitter typeahead.js plugin example usage
View typeahead.usage.html
<!-- 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">
View address-lookup
#!/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?';
View TestFrameworkInATweet.php
<?php
function it($m,$p){echo ($p?'✔︎':'')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
View base58.php
<?php
class base58
{
static public $alphabet = "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ";
public static function encode($int) {
$base58_string = "";
$base = strlen(self::$alphabet);
while($int >= $base) {
View gist:9256851
/**
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 );
View domtemplate.php
<?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;
@Xeoncross
Xeoncross / Controller\HomeController.php
Created Mar 13, 2014
Simple HTTP REST Controller wrapper for Silex based on https://gist.github.com/igorw/3646064
View Controller\HomeController.php
<?php
namespace Controller;
class HomeController
{
public function getAction($app)
{
return 'Hello!';
}
View facebook-sample.php
<?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.
You can’t perform that action at this time.