Skip to content

Instantly share code, notes, and snippets.

View wotta's full-sized avatar
Working from home

Wouter wotta

Working from home
View GitHub Profile
@wotta
wotta / pre-commit
Created August 3, 2020 12:40
GIT Ignore specific line from commit
#!/bin/bash
#
# This hook will look for code comments marked '//no-commit'
# - case-insensitive
# - dash is optional
# - there may be a space after the //
#
noCommitCount=$(git diff --no-ext-diff --cached | egrep -i --count "(@No|\/\/\s?no[ -]?)commit")
if [ "$noCommitCount" -ne "0" ]; then
echo "WARNING: You are attempting to commit changes which include a 'no-commit'."
@wotta
wotta / laravel-security-checker.md
Created March 20, 2019 07:56 — forked from barryvdh/laravel-security-checker.md
Symfony Security Checker in Laravel

Symfony Security Checker in Laravel

Artisan command for Sensiolabs Security Checker

Require this project in your composer.json file

"sensiolabs/security-checker": "2.x"

Add the following line to app/start/artisan.php:

@wotta
wotta / otf_file_update.php
Created August 26, 2018 20:28
Laravel nova snippets.
<?php
File::make('File')->disk('public')->hideFromIndex()->rules('required')->storeAs(function () {
$file = request()->file('file');
return 'fonts/'.$file->getClientOriginalName();
}),