Skip to content

Instantly share code, notes, and snippets.

View adampatterson's full-sized avatar
:octocat:

Adam Patterson adampatterson

:octocat:
View GitHub Profile
@adampatterson
adampatterson / gist:3961278
Created October 26, 2012 20:26
recursive_glob
/**
* Function: recursive_glob
* Recursively goes through a folder and returns all files.
*
* Parameters:
* $pattern - String
* $flags - Boolean
* $path - String
*
* Returns:
CREATE TABLE 'users' (
'id' bigint(20) unsigned NOT NULL AUTO_INCREMENT,
'email' varchar(100) NOT NULL DEFAULT '',
'username' varchar(60) NOT NULL DEFAULT '',
'password' varchar(64) NOT NULL DEFAULT '',
'type' varchar(25) DEFAULT NULL,
'data' text,
PRIMARY KEY ('id')
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
@adampatterson
adampatterson / php-upgrade.php
Created August 31, 2012 16:57
PHP Upgrade Script
<?
define('APP_PATH', __DIR__.'/');
function delete_dir($dir) {
if (substr($dir, strlen($dir)-1, 1) != '/')
$dir .= '/';
if ($handle = opendir($dir))
{
while ($obj = readdir($handle))
@adampatterson
adampatterson / inkdit.php
Created August 28, 2012 21:16
Inkdit Class
<?php
/*
// Ussage:
// documentation of this process and these example values are taken from
// https://inkdit.desk.com/customer/portal/articles/685178
require 'inkdit.php';
@adampatterson
adampatterson / columns
Created December 16, 2011 18:04
Columns
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Columns</title>
<style type="text/css" media="screen">
.container{
width: 75%;
display: block;
}
@adampatterson
adampatterson / git_pull
Created October 17, 2011 20:27
Git pull Helper
/**
* Git Pull
*
* @author Adam Patterson
* http://www.adampatterson.ca/blog/2011/10/diy-simple-staging-server/
*
* Use: echo pull();
*/
function pull ( )