Skip to content

Instantly share code, notes, and snippets.

View mrsimonbennett's full-sized avatar
👋

Simon Bennett mrsimonbennett

👋
View GitHub Profile
#!/bin/bash
wget http://uk1.php.net/distributions/php-5.4.15.tar.bz2
apt-get update
apt-get upgrade -yq
apt-get -yq install bzip2 openssl libxml2 libxml2-dev gcc make autoconf htop sudo git dstat
tar xvjf php-5*.tar.bz2
cd php-5*
cd ext/
git clone git://github.com/krakjoe/pthreads.git
cd ../
@mrsimonbennett
mrsimonbennett / Start Workers
Created March 2, 2014 12:50
Added Small Sleep
public function SpawnWorker($task)
{
for($i = 0; $i < $this->size; $i++)
{
$this->workers[$i] = new Worker($i,$this->loader);
$this->workers[$i]->start();
$this->workers[$i]->stack($task);
usleep(100); //Stops Crash
}
}
public function present($nest = true)
{
return array_map(
function ($model) use ($nest) {
return $this->createPresenter($model)->present($nest);
},
$this->collection
);
}
Or
@mrsimonbennett
mrsimonbennett / gist:739badfab7fb9d8f09f6
Last active August 29, 2015 14:11
My Question for #dev-discussions Friday 19th
Give you have the following classes
Member (entity)
MemeberRepository
RegisterMemberCommand (command request)
RegisterMemberCommandHandler (command handler)
MemeberWasRegistered (event)
Company (entity)
CompanyRepository
<?php
class one
{
protected $property = [
'test',
'test',
'test'
];
}
class tw0
<?php namespace Illuminate\Foundation\Http;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Illuminate\Http\Response;
use Illuminate\Http\JsonResponse;
use Illuminate\Routing\Redirector;
use Illuminate\Container\Container;
use Illuminate\Validation\Validator;
use Illuminate\Http\Exception\HttpResponseException;
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
/** @var Factory $view */
$view = $this->app->make('Illuminate\Contracts\View\Factory');
$view->composer('dashboard.settings.me.details', SettingsMeDetails::class);
<?php namespace KBC\Accounts;
use KBC\Accounts\Events\AccountWasDeleted;
use KBC\Accounts\Events\AccountWasOpened;
use KBC\Accounts\Events\MoneyWasWithdrawn;
use KBC\Accounts\Events\MoneyWasDeposited;
use KBC\Core\BaseModel;
final class Account extends BaseModel
{
<?php
namespace Invoicing;
use Members/User;
interface InvoiceRepository {
public function getUsersInvoices(User $user)
}
<?php
$browser->visit('Login')
->tap(
function (Browser $browser) {
$points = $browser->resolver->find("#TotalCount")->getText();
$this->mailer->send(
'mail',
['points' => $points],
function (Message $mailable) use ($browser, $points) {
$mailable->from('[email protected]', 'Pixelated Bot');