Skip to content

Instantly share code, notes, and snippets.

View cgsmith's full-sized avatar
👋
Available to work on your projects!

Chris Smith cgsmith

👋
Available to work on your projects!
View GitHub Profile
@cgsmith
cgsmith / vagrant.log
Created August 26, 2014 16:08
Vagrant Debug
$ VAGRANT_LOG=debug vagrant package --base freebsd-9.2 --vagrantfile freebsd-9.2.box
INFO global: Vagrant version: 1.6.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
<?=('services' == $navigationPage)?'class="active"':;?>
<?php
namespace Application\Router;
/**
* Class RestRoute
*
* Extends \Zend_Controller_Router_Route and handles methods in the router
*
* @author Chris Smith
*/
@cgsmith
cgsmith / Vagrantfile
Created March 4, 2015 01:57
Vagrant example with Ansible. This is a simple setup I use for Vagrant and Ansible for the majority of my projects. Note that my provisioning stuff is in a folder.
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
# Variables
data = YAML.load_file("provisioning/variables.yml")
Vagrant.require_version ">= 1.6.0"
Vagrant.configure("2") do |config|
<?php
/**
* Pre Zend 1.12.8
*/
$select = $this->getDbTable()->select();
$select->from(
$this->_getDbTable()->info(Zend_Db_Table_Abstract::NAME),
array(
"trim(concat_ws(' ', user.nameprefix, user.firstname, user.lastname)) as name",
"user.email",
<?php
/**
* After making necessary ZF 1.12.8 changes
*/
$nameColumn = new Zend_Db_Expr("trim(concat_ws(' ', user.nameprefix, user.firstname, user.lastname)) as name");
$select = $this->getDbTable()->select();
$select->from(
$this->_getDbTable()->info(Zend_Db_Table_Abstract::NAME),
array(
$nameColumn,
<?php
namespace Cgsmith\Form\Element;
/**
* Class Recaptcha
* Renders a div for google recaptcha to allow for use of the Google Recaptcha API
*
* @package Cgsmith
* @license MIT
* @author Chris Smith
<?php
namespace Cgsmith\Validate;
/**
* Class ValidateRecaptcha
* Handle validation against Google API
*
* @package Cgsmith
* @license MIT
* @author Chris Smith
<h1>Cart</h1>
<?php
require 'lib/myLibrary.php';
?>
<p>Your cart consists of <?=$_GET['item']. ' for $' . $inventory[$_GET['item']]/100;?></p>
<?php
class TransferHandler
{
/**
* @var string ftp host
*/
protected $targetFTPHost = "sftp.customer.com";
/**
* @var string ftp user