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 / 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
* @license BSD License (
* @example h = new GroovyHTTP('')
* h.setMethod('GET')
* h.setParam('q', 'groovy')
tony-landis / pdo-vs-adodb-benchmark.php
Created Dec 3, 2008
Quick and dirty PDO vs ADOdb benchmark
View pdo-vs-adodb-benchmark.php
#Quick and dirty PDO vs ADOdb benchmark
#PDO benchmark script:
$db = new PDO("mysql:dbname=logs;host=", "root", "");
$rs = $db->query("select * from ses limit 10")->fetchAll(PDO::FETCH_ASSOC);
foreach($rs as $r) {}
#ADOdb benchmark script
tony-landis / agilegallery.lzx.xml
Created Dec 5, 2008
AgileGallery Source Code
View agilegallery.lzx.xml
AgileGallery Source Code
Author: Tony Landis
License: GPL
Restrictions: Free for personal/commerical use, the link/credit must remain intact and visible
<?xml version="1.0" encoding="UTF-8"?>
tony-landis / gist:33018
Created Dec 7, 2008
Lua for Lighttpd to rewrite to a handler script if cached copy of requested file is missing
View gist:33018
cache_path = "/var/www/site/tmp"
cache_code = "compile"
-- render and cache to the filesystem
function cache_gen()
lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. "/index.php"
lighty.env["uri.query"] = "p=" .. string.gsub(lighty.env["uri.path"], "\.(htm|html)$", "")
--print ("CACHE: " .. lighty.env["uri.query"])
View gist:33019
require "../includes/smarty/Smarty.class.php";
$smarty = new Smarty;
$smarty->template_dir = 'templates';
$smarty->compile_dir = 'compile';
$smarty->cache_dir = '/var/www/site/tmp';
$smarty->caching = true;
$smarty->force_compile = true;
View gist:40145
* Provides a drop down field with multiple checkboxes
* @author Tony Landis
* @copyright Free for all use and modification. The author and copyright must be remain intact here.
* @class Ext.form.MultiSelectField
* @extends Ext.form.TriggerField
Ext.form.MultiSelectField = Ext.extend(Ext.form.TriggerField, {
triggerClass: 'x-form-trigger',
View gist:122669
from sqlalchemy.orm import *
from sqlalchemy import Table, Column, ForeignKey, Integer
from sqlalchemy.types import Integer, Unicode, String, DateTime
from pylons_openid.model import meta
def init_model(engine):
"""Call me before using any of the tables or classes in the model"""
meta.engine = engine
View gist:122670
__all__ = ["get_id", "require_login", "require_admin", "require_customer"]
from pylons.controllers.util import abort, redirect_to, url_for
from pylons import session
from decorator import decorator
_group_admin = ['admin']
_group_customer = ['admin','customer']
def get_id():
View gist:122674
import logging
from pylons import config, request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to, url_for
from pylons_openid.lib.base import BaseController, render
log = logging.getLogger(__name__)
import urllib2
import md5
import simplejson as json_
View gist:122675
You are logged in
<a href="/root/admin">
You can’t perform that action at this time.