Skip to content

Instantly share code, notes, and snippets.

View williamsodell's full-sized avatar

William S. O'Dell williamsodell

View GitHub Profile
@williamsodell
williamsodell / MY_Form_validation.php
Created September 15, 2014 16:40
Example of CodeIgniter Form_validation subclass
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/* app/libraries/MY_Form_validation */
class MY_Form_validation extends CI_Form_validation {
function __construct() {
parent::__construct();
}
protected function _execute($row, $rules, $postdata = NULL, $cycles = 0) {
if (preg_match("/(required_if)/", implode(' ', $rules), $temp)) {
@williamsodell
williamsodell / Functions
Last active August 29, 2015 14:00
StackScript to install the LAMP stack plus phusion passenger on apache2 and rvm defaulting to ruby 2.0.0 and rails 4
#!/bin/bash
# StackScript: 8644
##############################################################
# Generic functions
##############################################################
function system_update {
yum -y update
}
#!/bin/bash
dd if=/dev/zero of=/extraswap bs=1M count=512
mkswap /extraswap
echo "/extraswap none swap sw 0 0" >> /etc/fstab
swapon -a
#!/bin/sh
GLOBAL_OUTDIR="`pwd`/dependencies"
LOCAL_OUTDIR="./outdir"
LEPTON_LIB="`pwd`/leptonica-1.70"
TESSERACT_LIB="`pwd`/tesseract-3.03"
IOS_BASE_SDK="7.0"
IOS_DEPLOY_TGT="7.0"