Skip to content

Instantly share code, notes, and snippets.


Neil Millard neilmillard

View GitHub Profile
cambiata / testrest.php
Created Mar 22, 2011
Example controller extended from Controller_Cambiata_Rest
View testrest.php
* Test controller extending Controller_Cambiata_REST
* Jonas Nyström - cambiata
* To be used with a route like this one:
* Route::set('rest', 'rest(/<par1>(/<par2>(/<par3>(/<par4>(/<par5>)))))(.<format>)')
* ->defaults(array(
cambiata / rest.php
Created Mar 22, 2011
Rest Controller based on Kohana's and FuelPHP's
View rest.php
* Quickly assemled rest controller based on Kohana 3's Kohana_Controller_REST
* Added functionality from FuelPHP's Controller_Rest
* All credits to Kohana and FuelPHP teams!
* Jonas Nyström - cambiata
cambiata / httpauth.php
Created Mar 22, 2011
Basic Http Authentication
View httpauth.php
* Attempt to wrap Http Authentication into a separate class...
* Ideas and some code from FuelPHP Controller_Rest
Zeelot / bla.php
Created Aug 21, 2011 — forked from kiall/bla.php
View bla.php
<?php defined('SYSPATH') or die('No direct script access.');
class Model_Bla extends ORM {
public function rules()
return array(
'phone_one' => array(
array('at_least', array(':validation', 1, array('phone_one', 'phone_two', 'phone_three'))),
View gist:3830624
//method 1
import java.util.UUID
uuid = UUID.randomUUID()
//method 2
import static java.util.UUID.randomUUID
uuid = randomUUID()
sugendran / gist:4773412
Created Feb 12, 2013
CREATE UUID in Objective-C with ARC
View gist:4773412
// CREATE UUID in Objective-C with ARC
NSString* createUUID()
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStr = CFUUIDCreateString(kCFAllocatorDefault, uuid);
NSString *result = [NSString stringWithString:(__bridge NSString*)uuidStr];
return result;
View Twig Template Add function base64_encode
// Datos view Template
//Load lib
//config path template
export FOREMAN_SERVER=$foremanserver/api
export FOREMAN_USER=apiuser
export FOREMAN_PASSWORD=$password
export FOREMAN_HOME=/usr/share/foreman
export PATH=$PATH:/usr/local/bin
reverseIp() {
local a i n
IFS=. read -r -a a <<< "$1"
diegopacheco /
Last active Jan 6, 2016
AWS Route53 Fun with DNS: dig & cli53

How to Install on CentOs?

sudo yum install -y bind-utils
pip install cli53

Figureout the box name?

. /usr/share/foreman/config/hooks.d/lib/
. $FOREMAN_HOME/config/hooks.d/lib/
set -x
IP=$(hook_data host.ip)
REVERSE=$(reverseIp ${IP})
rdns_create() {
echolog IP ${IP} calling nsupdate: update add ${REVERSE} 86400 PTR $DNSNAME