Skip to content

Instantly share code, notes, and snippets.

View tmyers273's full-sized avatar

Tom tmyers273

View GitHub Profile
@tmyers273
tmyers273 / 422.json
Created July 12, 2020 07:14
Laravel JSON Error Responses
{
"message": "The given data was invalid.",
"errors": {
"email": ["The email field is required."],
"name": ["The name field is required."]
}
}
@tmyers273
tmyers273 / TwemproxyConnector.php
Created March 5, 2018 01:05
Laravel Twemproxy Driver
<?php
namespace App\Packages;
use Illuminate\Queue\Connectors\RedisConnector;
class TwemproxyConnector extends RedisConnector {
/**
* Establish a queue connection.
#!/bin/bash
# DEPRECATED. Use github.com/tmyers273/friac instead
LOGFILE='redis-setup.log'
touch $LOGFILE
# Setup
echo -ne "Starting redis setup..."
add-apt-repository ppa:chris-lea/redis-server
@tmyers273
tmyers273 / setup.sh
Created July 13, 2017 14:18
DO Block Storage Setup
volume=
while [ -z $volume ]
do
echo -n 'Enter volume name: '
read volume
done
echo "Volume = $volume"
echo -e "Stopping mysql...\c"
@tmyers273
tmyers273 / build.md
Last active July 13, 2017 01:00
ES6 Vue Package Build Process
const merge = require('webpack-merge')
const base = require('./webpack.base.config')
module.exports = merge(base, {
output: {
library: 'vue-confirmation'
}
})
const path = require('path')
const webpack = require('webpack')
module.exports = {
entry: path.resolve(__dirname, '../src/index.js'),
output: {
path: path.resolve(__dirname, '../dist'),
publicPath: '/dist/',
filename: 'index.js',
libraryTarget: 'umd'
@tmyers273
tmyers273 / DebouncedJob.php
Created December 10, 2016 18:38
Laravel Queued Job Debounce
<?php
namespace App\Jobs;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Cache;
abstract class DebouncedJob extends Job {
use InteractsWithQueue;