Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Julien Bourdeau julienbourdeau

🏠
Working from home
View GitHub Profile
@julienbourdeau
julienbourdeau / GitDetails.php
Created October 22, 2022 08:37
Show current Git hash (as version) with Laravel Blade component
View GitDetails.php
<?php
namespace App\View\Components\Admin;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\Component;
class GitDetails extends Component
{
const REPO = 'julienbourdeau/julienbourdeau.com';
@julienbourdeau
julienbourdeau / boilerplate.html
Last active October 4, 2021 07:58
Best HTML boilerplate from @mmatuzo
View boilerplate.html
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Unique page title - My Site</title>
<script type="module">
document.documentElement.classList.remove('no-js');
@julienbourdeau
julienbourdeau / setup.sh
Created January 14, 2021 19:08
New jetstream application
View setup.sh
laravel new secret-project
composer require laravel/jetstream
php artisan jetstream:install livewire --teams
composer require barryvdh/laravel-debugbar --dev
@julienbourdeau
julienbourdeau / deploy.sh
Created November 14, 2020 08:03
Rebuild assets and deploy on Laravel Forge
View deploy.sh
#!/usr/local/bin/bash
# function e_header() { printf "\n${yellow}========== %s ==========${reset}\n" "$@" }
# function e_arrow() { printf "➜ $@\n" }
# TODO: Check if current branch is `master`
e_header "Rebuilding assets"
echo
@julienbourdeau
julienbourdeau / CreateUserCommand.php
Created June 28, 2020 16:40
Laravel Create User Command
View CreateUserCommand.php
<?php
namespace App\Console\Commands\Dev;
use App\User;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
class CreateAdminUserCommand extends Command
@julienbourdeau
julienbourdeau / delegate.md
Last active June 3, 2020 11:07
Delegate read write to @Transporter
View delegate.md
@julienbourdeau
julienbourdeau / .php_cs
Last active November 8, 2020 19:14
Minimalist PHP CS Fixer config for Laravel
View .php_cs
<?php
$finder = PhpCsFixer\Finder::create()
->in([
__DIR__.'/app',
__DIR__.'/tests',
])
;
$rulesToDisable = [
@julienbourdeau
julienbourdeau / webpack.mix.js
Created April 20, 2020 06:43
Laravel Mix with multiple Tailwind config and PurgeCSS (separate Admin dashboard and Front app)
View webpack.mix.js
const mix = require('laravel-mix');
const tailwindcss = require('tailwindcss');
const rootPath = Mix.paths.root.bind(Mix.paths);
const tailwindPlugins = function(configFile, paths) {
const pluginList = [tailwindcss(configFile)];
if (mix.inProduction()) {
pluginList.push(require('@fullhuman/postcss-purgecss')({