Skip to content

Instantly share code, notes, and snippets.

View dmdavis's full-sized avatar

Dale Davis dmdavis

  • San Jose, CA
View GitHub Profile
@dmdavis
dmdavis / random_string.php
Created May 3, 2012 14:13
Random String (PHP)
<?php
/**
* Create a random string $l characters in length.
*
* @link http://www.php.net/manual/en/ref.strings.php#84888
* @param int $l number of characters (default: 10)
* @return string the random string
*/
function random_string($l = 10) {
@dmdavis
dmdavis / __init__.py
Created May 1, 2012 19:01
Nested Python Package using pkgutil
from pkgutil import extend_path
__base_path__ = __path__
__path__ = extend_path(__path__, __name__)
@dmdavis
dmdavis / __init__.py
Created March 5, 2012 16:59
Namespaced __init__.py
from pkgutil import extend_path
__base_path__ = __path__
__path__ = extend_path(__path__, __name__)