Skip to content

Instantly share code, notes, and snippets.

@psaia
psaia / menu.json
Created December 16, 2011 20:35
Sample result
[
{
"cat_id":12,
"name":"Dinner",
"order":0,
"items":{
"0":{
"name":"Grilled \"Pete Killin\" Cheese",
"description":"It's so freaking tasty.",
"price":3,
@psaia
psaia / hero.js
Created August 15, 2011 21:34
A framework for creating single page JavaScript apps easily.
/*
Author: Pete Saia
*/
/* Configuration
The name of the property should match the view (<section>)
ID. The route is the desired hash URI. The controller will be
<?php
class Bitly {
private $login;
private $appkey;
function __construct($login, $appkey)
{
$this->login = $login;
$this->appkey = $appkey;
}
function shorten($url)
@psaia
psaia / functions.php
Created July 14, 2011 03:59
Sample of Rye
<?php
/**
* -- Rye Configuration --
*
* Here you can declare your javascript files, custom menus,
* widgetized areas, custom post types and taxonomies.
*
*
* Project Name: <Name>
* PHP Developer: <Your Name>
@psaia
psaia / UserLocation.php
Created June 23, 2011 17:10
Geolocation
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
-------------------------------
Author: Pete Saia
Certifikid.com
*/
class User_location
{
@psaia
psaia / functions.php
Created February 24, 2011 23:30
A boilerplate functions file for WordPress
<?php
/**
* -- Configuration --
*
* Here you can add your javascript files, declare custom menus,
* add widgetized areas, and add custom post types. These variables
* are then processed inside the init() hook.
*
*/
@psaia
psaia / .bash_profile
Last active September 24, 2015 10:27
My .vimrc file
# Path.
export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/share/python:/usr/local/Cellar/php54/5.4.3/bin/:$PATH
# Black 0;30 Dark Gray 1;30
# Blue 0;34 Light Blue 1;34
# Green 0;32 Light Green 1;32
# Cyan 0;36 Light Cyan 1;36
# Red 0;31 Light Red 1;31
# Purple 0;35 Light Purple 1;35
# Brown 0;33 Yellow 1;33
/*
Site Name
Author
-----------------
Font Size Chart
-----------------
(Px) (%)
10 77
11 85
<?php
// $Id$
/**
* Bill Tracker
* A drupal module for tracking bills using class.hfdrumbone.php
* @Author Pete Saia
* @version 1.0
*/
require_once drupal_get_path('module', 'bill_tracker').'/hfdrumbone.class.php';
<?php
$production_server = strpos($_SERVER["SERVER_NAME"], 'theProductionServer.com') !== false;
$staging_server = strpos($_SERVER["SERVER_NAME"], 'theStagingServer.com') !== false;
if ($staging_server)
{
}
elseif ($production_server)
{