Skip to content

Instantly share code, notes, and snippets.

Anthony Landis tony-landis

Block or report user

Report or block tony-landis

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
@tony-landis
tony-landis / gist:31445
Created Dec 3, 2008
A HTTP POST/GET Helper Class for Groovy
View gist:31445
/**
* A Simple HTTP POST/GET Helper Class for Groovy
*
* @author Tony Landis
* @copyright 2007 Tony Landis
* @website http://www.tonylandis.com
* @license BSD License (http://www.opensource.org/licenses/bsd-license.php)
* @example h = new GroovyHTTP('http://www.google.com/search')
* h.setMethod('GET')
* h.setParam('q', 'groovy')
@tony-landis
tony-landis / smarty.json.php
Created Dec 3, 2008
Smarty JSON Plugin (PHP)
View smarty.json.php
<?php
/**
* Smarty {json} plugin
*
* Type: function
* Name: json
* Purpose: fetch json file and assign result as a template variable (array)
* @author Tony Landis
* @copyright 2007 Tony Landis
* @website http://www.tonylandis.com
View smarty.function.soap.php
<?php
/**
* Smarty {soap} plugin
*
* Type: function<br>
* Name: soap<br>
* Purpose: post http data and display results from soap webservice
* Params: url, post(true/false - passes along orig params), assign,
* Usage: {soap assign=soapResponse
* endpoint=http://www.site.com/search.soap
View pdo-singleton-class.php
<?php
/**
* PDO SINGLETON CLASS
*
* @author Tony Landis
* @link http://www.tonylandis.com
* @license Use how you like it, just please don't remove or alter this PHPDoc
*/
class sdb
@tony-landis
tony-landis / pdo-adodb-singleton-refactor.class.php
Created Dec 3, 2008
PHP PDO Singleton w/AdoDB backwards compatable
View pdo-adodb-singleton-refactor.class.php
<?php
/**
* PDO SINGLETON CLASS, ADODB ENABLED
*
* @author Tony Landis
* @link http://www.tonylandis.com
* @license Use how you like it, just please don't remove or alter this PHPDoc
*/
class sdb
{
View php-to-text-table-example.php
<?php
$data = array(
array('company'=>'AIG', 'id'=>1, 'balance'=> '-$99,999,999,999.00'),
array('company'=>'Wachovia', 'id'=>2, 'balance'=> '-$10,000,000.00'),
array('company'=>'HP', 'id'=>3, 'balance'=> '$555,000.000.00'),
array('company'=>'IBM', 'id'=>4, 'balance'=> '$12,000.00')
);
$renderer = new ArrayToTextTable($data);
@tony-landis
tony-landis / array-to-texttable.php
Created Dec 3, 2008
PHP: Array to Text Table Generation Class
View array-to-texttable.php
<?php
/**
* Array to Text Table Generation Class
*
* @author Tony Landis <tony@tonylandis.com>
* @link http://www.tonylandis.com/
* @copyright Copyright (C) 2006-2009 Tony Landis
* @license http://www.opensource.org/licenses/bsd-license.php
*/
class ArrayToTextTable
@tony-landis
tony-landis / pdo-vs-adodb-benchmark.php
Created Dec 3, 2008
Quick and dirty PDO vs ADOdb benchmark
View pdo-vs-adodb-benchmark.php
<?php
#Quick and dirty PDO vs ADOdb benchmark
#PDO benchmark script:
$db = new PDO("mysql:dbname=logs;host=127.0.0.1", "root", "");
$rs = $db->query("select * from ses limit 10")->fetchAll(PDO::FETCH_ASSOC);
foreach($rs as $r) {}
#ADOdb benchmark script
@tony-landis
tony-landis / CsvToArray.py
Created Dec 5, 2008
Convert CSV string to fixed width text table
View CsvToArray.py
"""
Convert CSV string to fixed width text table. Supports multi-line rows, column width limits, and creates a header row automatically
@author Tony Landis
@link http://www.tonylandis.com
@license GPL
"""
from math import ceil
class CsvToTxt():
@tony-landis
tony-landis / agilegallery.lzx.xml
Created Dec 5, 2008
AgileGallery Source Code
View agilegallery.lzx.xml
<!--
AgileGallery Source Code
Author: Tony Landis
Link: http://www.agilegallery.com
Link: http://www.tonylandis.com
License: GPL
Restrictions: Free for personal/commerical use, the link/credit must remain intact and visible
-->
<?xml version="1.0" encoding="UTF-8"?>
You can’t perform that action at this time.