Skip to content

Instantly share code, notes, and snippets.

Avatar

Stidges stidges

View GitHub Profile
@stidges
stidges / tailwind.itermcolors
Last active May 29, 2019
An iTerm2 color scheme based on the Tailwind CSS color scheme (https://tailwindcss.com/docs/colors)
View tailwind.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.17254902422428131</real>
@stidges
stidges / Request.php
Created Jan 1, 2018
Code to accompany the 'Reusable Validation Rules with Laravel Form Requests' post (https://stidges.com/reusable-validation-rules-with-laravel-form-requests)
View Request.php
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Validator;
abstract class Request extends FormRequest
{
/**
View keybase.md

Keybase proof

I hereby claim:

  • I am stidges on github.
  • I am stidges (https://keybase.io/stidges) on keybase.
  • I have a public key ASCfoJPTZueL1UgrbhO7O8vSDv5UEqmtxxAdhaQpnOeorAo

To claim this, I am signing this object:

@stidges
stidges / TestCase.php
Last active Sep 16, 2017
Easily test your Laravel middleware classes. Blog post: http://blog.stidges.com/post/testing-your-laravel-middleware
View TestCase.php
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestResponse;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use PHPUnit\Framework\Assert;
abstract class TestCase extends BaseTestCase
{
View AllowedUsernameValidator.php
<?php
# app/Validation/AllowedUsernameValidator.php
namespace App\Validation;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Routing\Router;
use Illuminate\Config\Repository;
@stidges
stidges / example.php
Created Dec 19, 2016
Using when() in the Laravel query builder
View example.php
<?php
namespace App\Http\Controllers;
use App\Post;
use Illuminate\Http\Request;
class PostsController extends Controller
{
public function index(Request $request)
@stidges
stidges / CacheBustingLaravelValetDriver.php
Last active Aug 21, 2018
Rewrite filename-based cache busting URIs (e.g. jquery.1476809927.js) to the correct filename in Laravel Valet
View CacheBustingLaravelValetDriver.php
<?php
class CacheBustingLaravelValetDriver extends LaravelValetDriver
{
public function isStaticFile($sitePath, $siteName, $uri)
{
$result = parent::isStaticFile($sitePath, $siteName, $uri);
if ($result !== false) {
return $result;
View FormBuilder.php
<?php
namespace Acme\Html;
use Illuminate\Html\FormBuilder as IlluminateFormBuilder;
class FormBuilder extends IlluminateFormBuilder {
/**
* An array containing the currently opened form groups.
@stidges
stidges / spinner.css
Last active Aug 29, 2015
Simple single-element spinner using CSS3 animations
View spinner.css
body {
background-color: #d6e0e6;
}
.spinner {
position: absolute;
top: 50%;
left: 50%;
margin-left: -21.5px;
margin-top: -21.5px;
You can’t perform that action at this time.