Skip to content

Instantly share code, notes, and snippets.

alias dc="docker-compose"
alias dcu="docker-compose up -d"
alias dcr="docker-compose down && docker-compose up -d"
alias dcd="docker-compose down"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gc="git checkout"
alias gcb="git checkout -b"
alias gf="git fetch"
alias gp="git pull"
alias gs="git stash -u"
@epixian
epixian / tempdir.php
Created October 29, 2020 13:08
PHP tempdir helper function
<?php
if (!function_exists('tempdir')) {
/**
* Create a unique temporary directory and return its path.
*
* Insipired by
* @link https://stackoverflow.com/questions/1707801/making-a-temporary-dir-for-unpacking-a-zipfile-into
*
* @param string $prefix
@epixian
epixian / webpack.mix.js
Created March 17, 2020 03:43
Laravel Mix / Tailwind UI / PurgeCSS configuration
const mix = require('laravel-mix');
require('laravel-mix-tailwind');
require('laravel-mix-purgecss');
/* Moment.js bloat */
const webpack = require('webpack');
mix.webpackConfig({
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
]
@epixian
epixian / deploy.sh
Last active September 12, 2019 14:20
A deployment script for Laravel projects hosted on Laravel Forge
function deploy() {
# install composer dependencies
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev &&
# install node modules
npm clean-install &&
# build assets using Laravel Mix
npm run production ||
return $?