Skip to content

Instantly share code, notes, and snippets.

View lewislarsen's full-sized avatar

Lewis lewislarsen

View GitHub Profile
@lewislarsen
lewislarsen / MagicLinkEmailTest.php
Created January 17, 2023 20:00
The tests used for adding magic links to your Laravel application.
// tests/Feature/Mail/Auth/MagicLinkEmailTest.php
<?php
use App\Mail\Auth\MagicLinkEmail;
use App\Models\User;
test('the mail has the correct contents', function () {
$user = User::factory()->create();
@lewislarsen
lewislarsen / instructions.md
Last active November 11, 2022 01:15
Add username availability checking into laravel inertia app

Instructions

This document will guide you on how to add username availability checking to your Laravel, Inertia Vue application during registration. This will not work for React.

Vue Step

There are multiple steps, first we will modify your Register.vue template found in resources\js\Pages\Auth.

Paste this code into your Register.Vue template near the submit function. This will define the username availability state as null initially and perform a request to our Laravel controller to determine if the username has been taken or not.

@lewislarsen
lewislarsen / aliases.txt
Last active January 15, 2023 12:37
Bash aliases
## CUSTOM ALIASES
alias commit='git add . && git commit .m'
alias gst='git status'
alias push='git push'
alias models='php artisan ide-helper:generate && php artisan ide-helper:meta && php artisan ide-helper:models'
alias dev='npm run dev'
alias rf='php artisan migrate:refresh'
alias rfs='php artisan migrate:refresh --seed'
alias art='php artisan'
alias phpstan='./vendor/bin/phpstan analyse --memory-limit=5G'
@lewislarsen
lewislarsen / payment.blade.php
Last active November 28, 2021 19:54
Recreated GitHub's sponsorship page in Tailwind (set tailwind.config.js to Inter Var font too!)
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}" xmlns:x-transition="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Sponsor @taylorotwell on GitHub Sponsors</title>
<link rel="shortcut icon" type="image/jpg" href="https://github.githubassets.com/favicons/favicon.png"/>
<link rel="preconnect" href="https://fonts.googleapis.com">
@lewislarsen
lewislarsen / avatar-lang.php
Last active August 25, 2021 00:18
Custom Avatar
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
@lewislarsen
lewislarsen / functions_custom.php
Last active August 25, 2021 00:17
Custom phpBB functions
<?php
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
@lewislarsen
lewislarsen / phpBB-nginx-config-ploi.conf
Created July 25, 2021 02:16
phpBB nginx config for Ploi
# Ploi Webserver Configuration, do not remove!
include /etc/nginx/ploi/domain.com/before/*;
server {
listen 80;
listen [::]:80;
root /home/ploi/domain.com;
server_name domain.com;
@lewislarsen
lewislarsen / keybase.md
Created January 17, 2021 16:36
Keybase Proof

Keybase proof

I hereby claim:

  • I am lewislarsen on github.
  • I am lewislarsen (https://keybase.io/lewislarsen) on keybase.
  • I have a public key ASBbT188eUWtiklG-M1vR4y2ZbXITjD2CsopAVeB52ny5Ao

To claim this, I am signing this object: