Skip to content

Instantly share code, notes, and snippets.

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

Joel Butcher joelbutcher

🏠
Working from home
View GitHub Profile
@joelbutcher
joelbutcher / .sh
Created October 18, 2023 14:23
Laravel Forge / Envoyer IP allowlist shell script
forgeIps=$(curl -L https://forge.laravel.com/ips-v4.txt)
for ip in $forgeIps
do
echo "Adding Laravel Forge IP $ip to SSH allowlist"
ufw allow from $ip to any port 22
done;
envoyerIps="159.65.47.205 157.245.120.132 134.122.14.47"
<?php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Symfony\Component\Console\Output\BufferedOutput;
use function Termwind\render;
use function Termwind\renderUsing;
uses(RefreshDatabase::class);
test('there are no down migrations', function () {
@joelbutcher
joelbutcher / LaravelTailwindPaginator.vue
Created September 4, 2022 21:57
A Vue.js implemetation of the Laravel Paginator Links for Blade
<script setup>
import {computed} from 'vue';
defineEmits(['fetchData']);
const props = defineProps({
paginator: {
type: Object,
required: true,
default: {
@joelbutcher
joelbutcher / laravel-valet-setup.sh
Last active September 23, 2021 19:27
A nice shell script for setting up a Laravel project using Homebrew, MySQL and Laravel Valet
#!/bin/sh
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
@joelbutcher
joelbutcher / iTermAutoDarkMode.md
Last active April 25, 2021 21:12 — forked from jamesmacfie/README.md
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@joelbutcher
joelbutcher / create.py
Created September 19, 2020 13:08
Python Create Project Automation
"""
Name: Python Create Project Automation.
Author: Joel Butcher
Date: 18/09/2020
This Python script is designed to run as a cli tool, accepting the project name as the only argment.
The script will, navigate to your desired projects path, create a new project folder and a README markdown document.
It will then create a new repo using your Github access token and commit the project + README.md to the remote origin.
Note: This file requires you to install the PiGithub Python dependency.
#!/usr/bin/env php
#
# Pre commit hook to run php unit tests.
# Place this file in .git/hooks and make it executable with:
#
# chmod +x .git/hooks/pre-commit
<?php
echo "Running tests.. ";
[alias]
lg = log --graph --decorate --branches --oneline --remotes --tags --all
s = status
co = checkout
ci = commit -m
cdiff = diff --cached
yoink = cherry-pick
ff = merge --ff-only
unchanged = update-index --assume-unchanged
changed = update-index --no-assume-unchanged
@joelbutcher
joelbutcher / material-ui-colors-400.less
Last active September 3, 2018 21:28
Material UI colours with social media and greyscale colours for less stylesheets
// Material UI Colours @400
@red: #EF5350;
@pink: #ec407a;
@purple: #ab47bc;
@deep-purple: #7e57c2;
@indigo: #5c6bc0;
@blue: #42a5f5;
@light-blue: #29b6f6;
@cyan: #26c6da;
@teal: #26a69a;