http://stuffandnonsense.co.uk/projects/protection-racket
If you use this GDPR privacy policy template, consider saying thank you with a small donation. https://paypal.me/malarkey/20gbp
Last updated: []
<?php | |
namespace App\Nova\Filters; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Carbon; | |
use Illuminate\Container\Container; | |
use Laravel\Nova\Filters\DateFilter as NovaDateFilter; | |
class DateFilter extends NovaDateFilter |
http://stuffandnonsense.co.uk/projects/protection-racket
If you use this GDPR privacy policy template, consider saying thank you with a small donation. https://paypal.me/malarkey/20gbp
Last updated: []
#!/usr/bin/env bash | |
# found on http://kamisama.me/2012/07/02/faster-php-lint/ | |
find my/folder/ -name "*.php" -print0 | xargs -0 -n1 -P8 php -l |
<? | |
//CSP only works in modern browsers Chrome 25+, Firefox 23+, Safari 7+ | |
$headerCSP = "Content-Security-Policy:". | |
"connect-src 'self' ;". // XMLHttpRequest (AJAX request), WebSocket or EventSource. | |
"default-src 'self';". // Default policy for loading html elements | |
"frame-ancestors 'self' ;". //allow parent framing - this one blocks click jacking and ui redress | |
"frame-src 'none';". // vaid sources for frames | |
"media-src 'self' *.example.com;". // vaid sources for media (audio and video html tags src) | |
"object-src 'none'; ". // valid object embed and applet tags src | |
"report-uri https://example.com/violationReportForCSP.php;". //A URL that will get raw json data in post that lets you know what was violated and blocked |
# The command finds the most recent tag that is reachable from a commit. | |
# If the tag points to the commit, then only the tag is shown. | |
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object | |
# and the abbreviated object name of the most recent commit. | |
git describe | |
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix: | |
git describe --abbrev=0 | |
# other examples |
# NOT FOR SHELL SCRIPT, but rather just for quick copy paste | |
# this is a copy-paste version with defaults of full shell script docker-xenial.sh | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D && \ | |
mkdir -p /etc/apt/sources.list.d && \ | |
echo deb https://apt.dockerproject.org/repo ubuntu-xenial main > /etc/apt/sources.list.d/docker.list && \ | |
service lxcfs stop && apt-get remove -y -q lxc-common lxcfs lxd lxd-client && \ | |
apt-get update -q && apt-get upgrade -y -q && \ | |
apt-get install -y -q linux-image-extra-$(uname -r) linux-image-extra-virtual && \ | |
apt-get install -y -q docker-engine && \ |
moved to github --> https://github.com/bill-auger/git-branch-status/ |
This is a ServiceWorker template to turn small github pages into offline ready app.
Whenever I make small tools & toys, I create github repo and make a demo page using github pages (like this one).
Often these "apps" are just an index.html
file with all the nessesary CSS and JavaScript in it. I wanted to cache this html file so that I can access my tools offline as well.
Make sure your github pages have HTTPS enforced, you can check Settings > GitHub Pages > Enforce HTTPS
of your repository.
Automatically limit your models to the current team
So you're using spark, and you have teams enabled. You start creating models and want to have them be team specific. Instead of writing, Model::where('team_id', auth()->user()->currentTeam->id)->get();
use this trait to add that behind the scenes so that every time you call on your model, it's assumed that you mean for the current team.
This assumes that the model has a team_id
, while it adds a scope of where team_id = currentTeam->id
.