Skip to content

Instantly share code, notes, and snippets.

@itsgoingd
itsgoingd / ClockworkConsoleSupport.php
Created May 13, 2020
clockwork symfony support poc
View ClockworkConsoleSupport.php
<?php namespace Clockwork\Support\Symfony;
use Clockwork\Clockwork;
use Clockwork\Support\Laravel\Console\CapturingFormatter;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
use Symfony\Component\Console\Event\ConsoleTerminateEvent;
use Symfony\Component\EventDispatcher\EventDispatcher;
@itsgoingd
itsgoingd / vanilla.md
Created Oct 18, 2018
Clockwork 3.1 vanilla integration docs
View vanilla.md

Installation

Install the Clockwork library via Composer.

$ composer require itsgoingd/clockwork

Initialize Clockwork early in your application.

@itsgoingd
itsgoingd / deploy.php
Created Aug 7, 2018
Deployer configuration for a Laravel app example
View deploy.php
<?php namespace Deployer;
require 'recipe/composer.php';
require 'recipe/npm.php';
require 'recipe/slack.php';
// Project name
set('application', 'Project Name');
// Project repository
@itsgoingd
itsgoingd / .gitlab-ci.yml
Created Aug 7, 2018
GitLab CD example for a Laravel app
View .gitlab-ci.yml
deploy to staging:
image: bobey/docker-gitlab-ci-runner-php7
environment:
name: staging
url: https://test.example.com
only:
- master
script:
- wget -q https://getcomposer.org/composer.phar
- mkdir -p ~/.ssh
@itsgoingd
itsgoingd / das_download.rb
Created Aug 5, 2018
Script to download all Destroy All Software screencasts w/ login (works as of Aug 2018)
View das_download.rb
#! /usr/bin/env ruby
# usage:
# $ das_download.rb email password
# based on various gists from this thread https://gist.github.com/maca/1798070
require "mechanize"
require "fileutils"
class DasDownloader
attr_reader :agent, :email, :password
View Kernel.php
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
View Lumen.php
<?php
namespace Dingo\Api\Routing\Adapter;
use ArrayIterator;
use ReflectionClass;
use FastRoute\Dispatcher;
use FastRoute\RouteParser;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
View gist:43c659e3f3db660fee4d
<?php
use SlimFacades\App as BaseAppFacade;
class App extends BaseAppFacade
{
// Bind a value into the Slim container
public static function bind($key, $value)
{
self::$app[$key] = $value;
@itsgoingd
itsgoingd / gist:86085598fb414b69a06c
Last active Aug 29, 2015
Clockwork Laravel exception handler
View gist:86085598fb414b69a06c
<?php
use Illuminate\Http\Response;
use Clockwork\Clockwork;
use Clockwork\Support\Laravel\ClockworkServiceProvider;
App::error(function(Exception $exception)
{
$app = app();
View gist:9617096
<?php
/* Example of a base model, which uses 0 instead of null value of the deleted_at as the deleted state when using soft-delete */
class BaseModel extends \Illuminate\Database\Eloquent\Model
{
/**
* Get a new query builder for the model's table.
*
* @param bool $excludeDeleted