Skip to content

Instantly share code, notes, and snippets.

View codepotato's full-sized avatar
👨‍💻
php artisan enable:beast-mode

Gareth Thompson codepotato

👨‍💻
php artisan enable:beast-mode
View GitHub Profile
@codepotato
codepotato / MakeAdminEntity
Last active February 10, 2021 16:06
Make a model, API resource controller, resource, and two requests automagically in Laravel
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
class MakeAdminEntity extends Command
{
/**
@codepotato
codepotato / deploy.sh
Last active October 6, 2021 20:45
Simplify deployments with Lasso and Laravel
echo "--------------------------------------"
echo "==> Lasso that shizzle"
echo "--------------------------------------"
php artisan lasso:publish
echo "--------------------------------------"
echo "==> Adding the created json to GIT"
echo "--------------------------------------"
git add -A
git commit -m "Updated assets wrangled 🤠"
@codepotato
codepotato / bash.sh
Created November 22, 2019 10:04
Remove all git repos that have already been merged with origin
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin
@codepotato
codepotato / Regex
Created October 11, 2019 09:24
UK Telephone Number Regex
/^(((\+44\s?\d{4}|\(?0\d{4}\)?)\s?\d{3}\s?\d{3})|((\+44\s?\d{3}|\(?0\d{3}\)?)\s?\d{3}\s?\d{4})|((\+44\s?\d{2}|\(?0\d{2}\)?)\s?\d{4}\s?\d{4}))(\s?\#(\d{4}|\d{3}))?$/
@codepotato
codepotato / mac-clear-icon-cache.sh
Created April 4, 2019 07:20 — forked from ismyrnow/mac-clear-icon-cache.sh
Clear the icon cache on a Mac when you start seeing generic icons in Finder or the Dock
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder
<template lang="html">
<div class="chat-composer" id="chat-composer">
<div class="columns">
<div class="column">
<editor :extensions="extensions" @update="onUpdate">
<div class="menubar" :class="{ 'is-focused': focused }" slot="menubar" slot-scope="{ nodes, marks, focused }">
<div v-if="nodes && marks">
<button
@codepotato
codepotato / bash.sh
Created May 1, 2018 09:29
Terminate all running node processes on your mac / linux machine
# This command is a great way of terminating any orphaned node processes running on your mac / linux machine. Useful if you use
# npm run watch or yarn run watch commands and want to free up your resources / memory.
killall -KILL node
@codepotato
codepotato / SimpleTwitterFeed.php
Last active December 13, 2015 19:09
Simple Twitter Feed display with caching.
<?php
$twitter_name = '';
$number_of_tweets = 2;
$url = "https://api.twitter.com/1/statuses/user_timeline/$twitter_name.xml?count=$number_of_tweets&include_rts=1callback=?";
$cache_expire = 3600; // in seconds
$ts = time();