Skip to content

Instantly share code, notes, and snippets.

@amereservant
amereservant / googlefusionapi.php
Created October 12, 2011 04:22
PHP Google Fusion API
<?php
/**
* Google Fusion Tables API
*
* These are PHP5 classes used to interact with the Google Fusion Tables API.
* The googleBase class provides an authentication class that any classes interacting
* with the Google API will need. It should be extended by a service-specific class
* that makes all of the calls to this class.
*
* The googleFusion class provides a public 'query()' method, allowing for SQL queries
@amereservant
amereservant / tc.framwork.base.php
Created October 12, 2011 17:36
WordPress Options Framework
<?php
/**
* TC Framework Base
*
* This is an abstract class that creates a standard base for all TC projects.
*
* All options are stored under two WordPress options, one for the standard options
* and another for the multisite options (if the theme/plugin has need for these).
*
* @author Amereservant <amereservant@gmail.com>
@amereservant
amereservant / auth.php
Created October 22, 2011 23:10
phpFlickr API Detailed Example HowTo
<?php
/* Last updated with phpFlickr 3.1
*
* Edit these variables to reflect the values you need. $default_redirect
* and $permissions are only important if you are linking here instead of
* using phpFlickr::auth() from another page or if you set the remember_uri
* argument to false.
*/
// Include configuration file
@amereservant
amereservant / style.css
Created November 16, 2011 05:37
My Default Template
/* Reset and set defaults
-------------------------------------------------------------------------------*/
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video { margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline; background:transparent }
article, aside, figure, footer, header, hgroup, nav, section { display:block }
img, object, embed { max-width:100% }
/* force a vertical scrollbar to prevent a jumpy page */
html { overflow-y:scroll }
@amereservant
amereservant / index.html
Created February 9, 2012 14:46
HTML5 Template
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title></title>
<meta name="description" content="" />
<meta name="author" content="" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" href="style.css" />
<!--
@amereservant
amereservant / index.php
Created October 2, 2012 06:08
Youtube API - Keywords
<!DOCTYPE html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Youtube API Test</title>
<meta name="description" content="" />
<meta name="author" content="" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
</head>
<body>
<?php
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
/**
* Blog Template
*
Template Name: Blog Excerpt (summary)
*
@amereservant
amereservant / biblebooks.php
Last active January 5, 2021 21:05
Simple PHP array of the Books of the Bible
<?php
$books = array(
1 => 'Genesis',
2 => 'Exodus',
3 => 'Leviticus',
4 => 'Numbers',
5 => 'Deuteronomy',
6 => 'Joshua',
7 => 'Judges',
8 => 'Ruth',
@amereservant
amereservant / my_wp_settings.class.php
Last active December 18, 2015 11:59
A simple Wordpress plugin/theme options class. This is basically from the Codex and I just modified it to use class properties to make customizing it a little simpler.
<?php
/**
* Plugin/Theme Options
*
* @link http://codex.wordpress.org/Creating_Options_Pages#Example_.232
* @link https://gist.github.com/amereservant/5779754
* @requires Wordpress 3.5.1 =<
*/
class wctest
{
@amereservant
amereservant / base64_encode.php
Last active December 18, 2015 13:29
How to Base64 Encode images using PHP for both inline image elements and for CSS rules.
<?php
/**
* Base64 Encode images with PHP
*
* This example shows how to use PHP to Base64 encode images for both inline image
* elements as well as for CSS background image properties.
*
* @link https://gist.github.com/amereservant/5790788
*/
function base64_encode_image($filename='',$filetype='')