Skip to content

Instantly share code, notes, and snippets.

@itsgoingd
itsgoingd / ClockworkConsoleSupport.php
Created May 13, 2020 20:22
clockwork symfony support poc
<?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 October 18, 2018 19:55
Clockwork 3.1 vanilla integration docs

Installation

Install the Clockwork library via Composer.

$ composer require itsgoingd/clockwork

Initialize Clockwork early in your application.

@itsgoingd
itsgoingd / deploy.php
Created August 7, 2018 10:32
Deployer configuration for a Laravel app example
<?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 August 7, 2018 10:29
GitLab CD example for a Laravel app
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 August 5, 2018 15:11
Script to download all Destroy All Software screencasts w/ login (works as of Aug 2018)
#! /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
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
<?php
namespace Dingo\Api\Routing\Adapter;
use ArrayIterator;
use ReflectionClass;
use FastRoute\Dispatcher;
use FastRoute\RouteParser;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
<?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 August 29, 2015 14:01
Clockwork Laravel exception handler
<?php
use Illuminate\Http\Response;
use Clockwork\Clockwork;
use Clockwork\Support\Laravel\ClockworkServiceProvider;
App::error(function(Exception $exception)
{
$app = app();
<?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