Skip to content

Instantly share code, notes, and snippets.

View brandonsavage's full-sized avatar

Brandon Savage brandonsavage

View GitHub Profile
{
"require-dev": {
"laravel/homestead": "^5"
},
"autoload": {
"psr-4": {
"Masterclass\\": "src/"
}
}
<?php
$class = new stdClass();
$class->abc = 'def';
$class->ghi = 'jkcl';
$classDetails = (array)$class;
list($abc, $def) = $classDetails;
$bestFriendsOnly = true;
$user->getFriends($bestFriendsOnly);
import unittest
class MyUnitTest(unittest.TestCase):
def testAddition(self):
a = 1 + 1
self.assertEqual(2, a)
if __name__ == '__main__':
unittest.main()
@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',
@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;
}
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
array (size=4)
'controller' => null
'action' => string 'Application\Controller\Index' (length=28)
'responder' => string 'Application\Responder\Index' (length=27)
'method' => string 'index' (length=5)

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:

<?php
$five_days_ago = date('C', strtotime('Five days ago'));