Skip to content

Instantly share code, notes, and snippets.

{% set key = 'something' %}
{% set variable = 'something else' %}
// What I expect is the value of 'something' to be passed, NULL is passed
{{ variable | custom_filter(key) }}
// This passes 'key'
{{ variable | custom_filter('key') }}
// outputs 'something' correctly
rm -rf *
scott@home:/tmp/composer$ time composer require exussum12/xxhash
Using version ^1.1 for exussum12/xxhash
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 29 installs, 0 updates, 0 removals
- Installing sebastian/version (2.0.1): Loading from cache
- Installing sebastian/resource-operations (2.0.1): Loading from cache
- Installing sebastian/recursion-context (3.0.0): Loading from cache
@exussum12
exussum12 / docker-compose.yml
Created June 30, 2020 15:54
Xdebug PHP FPM
web:
image: nginx:latest
ports:
- "9991:80"
volumes:
- ./site.conf:/etc/nginx/conf.d/default.conf
links:
- php
php:
build: php
@exussum12
exussum12 / generate.sh
Created July 3, 2018 20:46
FlippingBook to PDF
#!/bin/bash
mkdir -p out
for i in $(seq 1 120); do
page=`printf "%04d" $i`;
wget "https://www.website/files/assets/common/page-html5-substrates/page${page}_4.jpg"
wget "https://www.website/files/assets/common/page-vectorlayers/${page}.svg"
convert -flatten -geometry 1149x2550 -fuzz 10% -transparent white -density 400 page${page}_4.jpg $page.svg out/$page.pdf
@exussum12
exussum12 / basicFileServer.php
Created November 16, 2017 22:30
Basic file server for use with saving coverage info
<?php
function finishRequest($responseCode) {
http_response_code($responseCode);
die();
}
$storageDirectory = "upload";
$fileName = $_GET['hash'];
if (!ctype_alnum($fileName) || strlen($fileName) < 5) {
@exussum12
exussum12 / ClearCookies
Created December 18, 2013 09:41
Nuke Cookies - attempt many combinations of cookie pathname + hosts and try to clear them all
function nukeCookies(quiet) {
if(typeof quiet == undefined) quiet = false;
var cookies = $.cookie();
var hosts = window.location.hostname.split(".");
var path = window.location.pathname.split("/");
path.shift();
for(var cookie in cookies) {
//domain and path need to match, Try some combinations
$.removeCookie(cookie);
for(i = 0; i < hosts.length; i++){