Skip to content

Instantly share code, notes, and snippets.

View NtimYeboah's full-sized avatar
🏠
Working from home

Ntim Yeboah NtimYeboah

🏠
Working from home
View GitHub Profile
@NtimYeboah
NtimYeboah / gist:244bcdb3a6866357e80f
Created March 3, 2016 16:48 — forked from Urbiwanus/gist:c1e456f889f53e940a11
Cordova Paypal Integration AngularJS
app.factory('PaypalService', ['$q', '$ionicPlatform', 'shopSettings', '$filter', '$timeout', function ($q, $ionicPlatform, shopSettings, $filter, $timeout) {
var init_defer;
/**
* Service object
* @type object
*/
var service = {
@NtimYeboah
NtimYeboah / Laravel-Container.md
Created November 4, 2017 13:17
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

Accessing the Container

@NtimYeboah
NtimYeboah / selenium-php-webdriver-cheatsheet.md
Created November 15, 2017 09:52 — forked from aczietlow/selenium-php-webdriver-cheatsheet.md
Cheat sheet for using php webdriver (facebook/webdriver).

Webdriver PHP API workthough

  • Open a browser

    # start an instance of firefox with selenium-webdriver
    
    $browser_type = 'firefox'
    $host = 'http://localhost:4444/wd/hub'
    

$capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => $browser_type);

<?php
class RequestClient
{
private $curl;
private $baseUrl = env('BASE_URL');
public function __construct()
{
<?php
class RequestClient
{
private $curl;
private $baseUrl = env('BASE_URL');
public function __construct()
{
<?php
class RequestClient
{
protected $curl;
private $baseUrl = env('BASE_URL');
public function __construct()
{
<?php
namespace Kudobuzz\Contracts;
use Kudobuzz\Entities\Order;
interface OrderInterface
{
public function create(Order $order);
}
<?php
namespace Kudobuzz\Entities;
use Kudobuzz\Contracts\OrderInterface;
class Customer implements OrderInterface
{
public function create()
{
<?php
namespace Kudobuzz\Entities;
use Kudobuzz\Contracts\OrderInterface;
class Lead implements OrderInterface
{
public function create()
{
//...Some stuff
<?php
namespace App\Jobs;
use Kudobuzz\Contracts\OrderInterface;
class AddOrder
{
private $request;