Skip to content

Instantly share code, notes, and snippets.

View philipobenito's full-sized avatar

Phil Bennett philipobenito

  • Barnsley, Yorkshire, England
View GitHub Profile
@philipobenito
philipobenito / init.coffee
Last active December 8, 2017 15:58
Atom sync
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# don't recommend running as one script
# list merged remote branches
git branch -a --merged live | grep -v live
# delete remote merged branches
git branch -a --merged live | grep -v live | xargs -n 1 git push --delete origin
# list merged local branches
git branch --merged live | grep -v live
<?php
class FooTest extends PHPUnit_Framework_Testcase
{
public function testDoSomethingEditsDataAndReturnsArray()
{
$foo = new Foo;
$user = [
'name' => 'Phil',
<?php
class FooTest extends PHPUnit_Framework_Testcase
{
public function testDoSomethingEditsDataAndReturnsArray()
{
$foo = new Foo;
$user = [
'name' => 'Phil',
<?php
class FakeBar
{
public $users = [
1 => [
'name' => 'Adam',
'email' => 'adam@example.com'
]
];
<?php
class FooTest extends PHPUnit_Framework_Testcase
{
public function testDoSomethingEditsDataAndReturnsArray()
{
$foo = new Foo;
$bar = new Bar;
$user = $foo->doSomething($bar, 1, , 'Phil', 'hello@example.com');
<?php
class Foo
{
protected $bar;
public function doSomething($bar, $id, $name, $email)
{
$this->bar = $bar;
// .. possibly manipulate $id, $name and $email
<?php
class Foo
{
public function doSomething($id, $name, $email)
{
$bar = new Bar;
// .. possibly manipulate $id, $name and $email
Verifying that +philipobenito is my blockchain ID. https://onename.com/philipobenito
<?php
$container = new League\Container\Container;
$container->add('Zend\Diactoros\ServerRequest', function () {
return Zend\Diactoros\ServerRequestFactory::fromGlobals(
$_SERVER,
$_GET,
$_POST,
$_COOKIE,