Skip to content

Instantly share code, notes, and snippets.

View tristanbailey's full-sized avatar
🏭
Talking to manufacturers

Tristan Bailey tristanbailey

🏭
Talking to manufacturers
View GitHub Profile
Has aliases
Has triggers on a schedule
Has different job steps
@tristanbailey
tristanbailey / .circleci.config.yml
Created September 27, 2019 09:16
CircleCI Working example config for php Laravel 2019-09
# PHP CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-php/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/php:7.2-node-browsers
# CircleCI defaults:
<?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
@tristanbailey
tristanbailey / GDPR.md
Created October 11, 2018 12:23
(Data) Protection Racket
@tristanbailey
tristanbailey / Contract Killer 3.md
Created October 11, 2018 12:22 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@tristanbailey
tristanbailey / phplint-folder.sh
Created October 11, 2018 09:00 — forked from james2doyle/phplint-folder.sh
Use PHP lint on a folder of PHP files
#!/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
@tristanbailey
tristanbailey / cspheader.php
Created January 11, 2018 16:04 — forked from phpdave/cspheader.php
CSP Header for PHP or Apache or .htaccess - Content Security Protocol
<?
//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
@tristanbailey
tristanbailey / get-latest-tag-on-git.sh
Last active December 22, 2017 10:20 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
# 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
@tristanbailey
tristanbailey / index.html
Created December 6, 2017 13:59
Vuejs add form rows
<html>
<head>
<meta charset="UTF-8" />
<title>Example Dynamic Form</title>
<script src="https://unpkg.com/vue@2.1.10/dist/vue.js"></script>
<style>
.fileContainer {
overflow: hidden;
position: relative;
@tristanbailey
tristanbailey / index.html
Created November 13, 2017 13:14
Ripple events down to components using watch
<div id="app">
<button @click="changeAll(true)">
OPEN ALL THE BOXES
</button>
<button @click="changeAll(false)">
Close ALL THE BOXES
</button>
<drop-down :override="override">Hello</drop-down>
<drop-down :override="override">Hello</drop-down>