Skip to content

Instantly share code, notes, and snippets.

View gsdevme's full-sized avatar

Gavin Staniforth gsdevme

View GitHub Profile
<?php
class System
{
public static function run()
{
$args = func_get_args();
if (!empty($args)) {
@gsdevme
gsdevme / tooltips
Created December 4, 2011 00:39
Tooltips from title="" attributes
(function(doc, undefined){
var e = doc.querySelectorAll('a.tooltip'), s;
if(e !== undefined){
for(i=0;i<e.length;++i){
s = document.createElement('span'),
s.className='tooltip',
s.innerHTML = e[i].getAttribute('title'),
s.style.padding = '0 15px';
@gsdevme
gsdevme / gist:1394745
Created November 26, 2011 00:28
test
<?php
class foo
{
}
@gsdevme
gsdevme / db.php
Created August 20, 2011 19:24
Query Setup
<?php
try {
$return = ( bool ) !preg_match('/(^INSERT|^DELETE|^UPDATE)/i', $query);
$stmt = $this->_pdo->prepare($query);
if ($args->count() !== 0) {
for ($args; $args->valid(); $args->next()) {
$value = $args->current();
$data = $this->_dataType($value);