Skip to content

Instantly share code, notes, and snippets.

View Mulkave's full-sized avatar
🍅
binge coding

Abed Halawi Mulkave

🍅
binge coding
View GitHub Profile
<?php
/**
* @dataProvider generousDataProvider::giveMeInput()
*/
public fucntion test_thy_feature($input)
{
// Mock Job that make an external HTTP request
$mOperation = Mockery::mock(GetTheBeansOperation::class, [$input])->makePartial();
$mOperation->shouldReceive('run')
#!/bin/bash
echo -n "GitHub User: "
read USER
echo -n "GitHub Password: "
read -s PASS
echo ""
echo -n "GitHub Repo (e.g. foo/bar): "
@Mulkave
Mulkave / gcrgc.sh
Created October 28, 2017 16:27 — forked from ahmetb/gcrgc.sh
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
<?php
class CreateArticleFeature extends Feature
{
public function handle(Request $request)
{
$this->run(new ValidateArticleInputForCreationJob($request->input()));
// process cover photo
$cover = $this->run(ProcessArticleCoverOperation::class);
<?php
class ProcessArticleCoverOperation extends Operation
{
public function handle(Request $request)
{
$photo = $this->run(MakePhotoFromDataJob::class, ['data' => $request->input('photo')]);
$this->run(new ValidateCoverPhotoDimensionsJob($photo));
$variations = $this->run(new GeneratePhotoVariationsJob($photo));
$uploads = $this->run(new UploadFilesToCdnJob($variations));
<?php
class UpdateArticleFeature extends Feature
{
public function handle(Request $request)
{
$this->run(new ValidateArticleInputForUpdateJob($request->input()));
// process cover photo
$photo = $this->run(MakePhotoFromDataJob::class, ['data' => $request->input('photo')]);
<?php
class CreateArticleFeature extends Feature
{
public function handle(Request $request)
{
$this->run(new ValidateArticleInputForCreationJob($request->input()));
// process cover photo
$photo = $this->run(MakePhotoFromDataJob::class, ['data' => $request->input('photo')]);

Trellis • My Service

This service fetches ghosts and throws them at every client requesting it, in the hope of being haunted.

Namespace: Trellis\MyService

Requirements

  • PHP >= 5.6.4
  • OpenSSL PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
<?php
namespace Directory\Domains\Http\Jobs;
use Directory\Foundation\AbstractJob;
use Illuminate\Routing\ResponseFactory;
class RespondWithJsonJob extends AbstractJob
{
private $content;
<?php
namespace Directory\Services\Site\Tests\Features;
use Faker\Factory as Faker;
use Directory\Foundation\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
class RegisterCitizenFeatureTest extends TestCase
{