Skip to content

Instantly share code, notes, and snippets.

View brandonsavage's full-sized avatar

Brandon Savage brandonsavage

View GitHub Profile
@brandonsavage
brandonsavage / upgrade.sql
Created September 21, 2012 20:16
SQL to upgrade bouncer
ALTER TABLE `geoip_regions` ADD COLUMN `fallback_id` integer;
ALTER TABLE `geoip_regions` ADD CONSTRAINT `fallback_id_refs_id_e6bfe66d` FOREIGN KEY (`fallback_id`) REFERENCES `geoip_regions` (`id`);
CREATE INDEX `geoip_regions_e28329c2` ON `geoip_regions` (`fallback_id`);
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
)
ALTER TABLE mirror_products ADD COLUMN `ssl_only` tinyint(1) NOT NULL DEFAULT 0;
<?php
$five_days_ago = date('C', strtotime('Five days ago'));

Keybase proof

I hereby claim:

  • I am brandonsavage on github.
  • I am brandonsavage (https://keybase.io/brandonsavage) on keybase.
  • I have a public key whose fingerprint is C2FA CF78 22B2 6ACC F6DD 52A9 55FB 2D3F 9846 40F1

To claim this, I am signing this object:

array (size=4)
'controller' => null
'action' => string 'Application\Controller\Index' (length=28)
'responder' => string 'Application\Responder\Index' (length=27)
'method' => string 'index' (length=5)
object(Aura\Router\Route)[181]
protected 'name' => string 'auth' (length=4)
protected 'path' => string '/' (length=1)
protected 'params' =>
array (size=0)
empty
protected 'regex' => null
protected 'matches' =>
array (size=0)
empty
@brandonsavage
brandonsavage / gist:801f921012d553b1a95d
Created January 7, 2015 15:03
My favorite function in PHP...
public function configure(array $values = array())
{
foreach ($values as $key => $value) {
if (property_exists($this, $key)) {
$this->$key = $value;
}
}
return $this;
}
@brandonsavage
brandonsavage / config.php
Created February 14, 2015 00:01
The configuration file for the final lesson.
<?php
$path = realpath(__DIR__ . '/..');
return array(
'path' => $path,
'database' => array(
'user' => 'root',
import unittest
class MyUnitTest(unittest.TestCase):
def testAddition(self):
a = 1 + 1
self.assertEqual(2, a)
if __name__ == '__main__':
unittest.main()