Skip to content

Instantly share code, notes, and snippets.

View neilmillard's full-sized avatar

Neil Millard neilmillard

View GitHub Profile
@diegopacheco
diegopacheco / aws-dns-route53-dig.md
Last active January 6, 2016 17:05
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?

@ddoc
ddoc / utils.sh
Created January 15, 2014 23:19
utility functions for foreman_hooks https://github.com/theforeman/foreman_hooks
#!/bin/bash
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"
// Datos view Template
$data=array(
//...
);
//Load lib
require_once'libs/Twig/Autoloader.php';
Twig_Autoloader::register();
//config path template
@sugendran
sugendran / gist:4773412
Created February 12, 2013 21:08
CREATE UUID in Objective-C with ARC
// 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];
CFRelease(uuid);
CFRelease(uuidStr);
return result;
@iocopocomaioco
iocopocomaioco / gist:3830624
Created October 3, 2012 23:49
Generate a UUID
//method 1
import java.util.UUID
uuid = UUID.randomUUID()
//method 2
import static java.util.UUID.randomUUID
uuid = randomUUID()
@zeelot
zeelot / bla.php
Created August 21, 2011 18:03 — forked from kiall/bla.php
Valid::at_least()
<?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'))),
),
@cambiata
cambiata / httpauth.php
Created March 22, 2011 07:09
Basic Http Authentication
<?php
/**
* Attempt to wrap Http Authentication into a separate class...
*
* Ideas and some code from FuelPHP Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
*/
@cambiata
cambiata / rest.php
Created March 22, 2011 07:07
Rest Controller based on Kohana's and FuelPHP's
<?php
/**
* Quickly assemled rest controller based on Kohana 3's Kohana_Controller_REST
* https://github.com/kohana/core/blob/3.1%2Fmaster/classes/kohana/controller/rest.php
*
* Added functionality from FuelPHP's Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
* All credits to Kohana and FuelPHP teams!
* Jonas Nyström - cambiata
@cambiata
cambiata / testrest.php
Created March 22, 2011 07:06
Example controller extended from Controller_Cambiata_Rest
<?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(