Skip to content

Instantly share code, notes, and snippets.

Avatar
🌵
In the desert

Stephen Howells stephenhowells

🌵
In the desert
View GitHub Profile
@tanthammar
tanthammar / HasLinks.php
Last active Jul 1, 2021
No more controllers! Only Laravel LiveWire routes and a handy Eloquent Model trait.
View HasLinks.php
@tanthammar
tanthammar / session-timeout-alert-after-livewire-scripts.blade.php
Last active Apr 5, 2021
Laravel Livewire Turbolinks Blade component to keep session alive
View session-timeout-alert-after-livewire-scripts.blade.php
{{-- You do not need to add this component if you are using the permanent option in the head component --}}
<script>
if (!window.sessionTimerPermanent && window.Livewire) {
window.livewire.hook('afterDomUpdate', startSessionTimer)
}
// if you are on livewire > 1.3.1 and want to avoid the default error alert
// https://github.com/livewire/livewire/pull/1146
window.livewire.onError(statusCode => {
if (statusCode === 419) {
@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active Dec 1, 2021
PHP CS Fixer - Laravel Coding Style Ruleset
View .php-cs-fixer.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@fzldn
fzldn / beautifier.js
Last active Nov 7, 2021
VS Code Laravel Blade formatter using extension Beautify 1.5.0 by HookyQR with js-beautify hacks
View beautifier.js
...
Beautifier.prototype.beautify = function() {
...
var source_text = this._source_text;
// BEGIN
source_text = source_text.replace(/\{\{(--)?((?:(?!(--)?\}\}).)+)(--)?\}\}/g, function(m, ds, c, dh, de) {
@JaminFarr
JaminFarr / blade-mixins.pug
Last active Apr 16, 2020
Laravel Blade mixins for jade for use with laravel-elixir-jade
View blade-mixins.pug
//- For use with https://github.com/CREEATION/laravel-elixir-jade
mixin blade()
='\r\n'
block
='\r\n'
mixin phpblock()
!='\r\n<?php '
@franzose
franzose / jade-to-laravel-blade-mixins.jade
Last active Dec 30, 2019
Jade -> Laravel Blade mixins
View jade-to-laravel-blade-mixins.jade
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')
@kevinelliott
kevinelliott / osx-10.10-setup.md
Last active Oct 27, 2021
Mac OS X 10.10 Yosemite Setup
View osx-10.10-setup.md

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@laracasts
laracasts / MailTestCase.php
Created Jun 14, 2014
Use Mailcatcher to test email.
View MailTestCase.php
<?php
use GuzzleHttp\Message\Response;
class MailTestCase extends TestCase {
protected $mailcatcher;
function __construct()
{
View VagrantXDebug.md

Configure

xdebug.ini

xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
@qguv
qguv / solarized-dark.css
Last active Apr 5, 2021 — forked from nicolashery/solarized-dark.css
Solarized theme for Jekyll, updated to reflect toned-down line numbers
View solarized-dark.css
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content