Skip to content

Instantly share code, notes, and snippets.

@tony-landis
tony-landis / smarty.function.soap.php
Created December 3, 2008 07:23
Smarty Soap Plugin (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
@tony-landis
tony-landis / smarty.json.php
Created December 3, 2008 07:15
Smarty JSON Plugin (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
@tony-landis
tony-landis / pdo-adodb-singleton-refactor.class.php
Created December 3, 2008 07:44
PHP PDO Singleton w/AdoDB backwards compatable
<?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
{
@tony-landis
tony-landis / recurse_image_optimize.sh
Created October 18, 2012 01:36
Recursively Optimize JPGs and PNGs using PNGCRUSH and JPEGTRAN
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for png in `find . | grep .png`; do
echo "crushing $png ..."
pngcrush -rem alla -reduce -brute "$png" temp.png
@tony-landis
tony-landis / s3_rackspace_migrate.py
Created February 1, 2012 23:06
Migrate from S3 to Rackspace Cloud Files
#!/usr/bin/python
"""
S3 to Rackspace Cloud Files Migration
This script will copy the contents of a S3
bucket to to a Rackspace Cloud Files container.
Depends on the boto and python_cloudfiles python libraries.
@tony-landis
tony-landis / sangoma.sh
Created September 17, 2011 01:55
Automate installation of dahdi, libpri, sangoma, and all deps on debian
#!/bin/bash
DA='dahdi-linux-complete-2.5.0.1+2.5.0.1'
WAN="wanpipe-3.5.23"
PRI="libpri-1.4.12"
apt-get -y install build-essential
apt-get -y install gcc
apt-get -y install g++
apt-get -y install automake
@tony-landis
tony-landis / array-to-texttable.php
Created December 3, 2008 08:00
PHP: Array to Text Table Generation Class
<?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
<?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);
import * as React from 'react';
import { NextPageContext } from 'next';
import Error from 'next/error'
import Head from 'next/head';
import compact from 'lodash/compact';
// import find from 'lodash/find';
// Material
import { Theme, withStyles, WithStyles, createStyles } from '@material-ui/core/styles';
import Avatar from '@material-ui/core/Avatar';
import Button from '@material-ui/core/Button';