Skip to content

Instantly share code, notes, and snippets.

View trollboy's full-sized avatar
☠️
I may be a grue.

Matt Wiseman trollboy

☠️
I may be a grue.
View GitHub Profile
This file has been truncated, but you can view the full file.
;FLAVOR:Marlin
;TIME:13634
;Filament used: 5.59053m
;Layer height: 0.141421
;Setting summary:
; CATEGORY: Crealitybelt
; Belt Wall Speed: 10
; Enable Secondary Print Fans: True
; Secondary Print Fan Speed: 50
; CATEGORY: Machine
@trollboy
trollboy / errorHandler.php
Created August 23, 2020 21:17
basic production error handling
<?php
/**
* Extending for typing
*
*/
class ErrorException extends Exception {}
/**
* Default exception handler, IRL you probably have some
$data = 'cat';
function foobar() {
$data = 'dog';
}
echo $data;
foobar();
echo $data;
@trollboy
trollboy / postprocessor.sh
Created September 2, 2018 02:10
My crappy postprocessor.sh
#! /bin/bash
FILENAME=$1 # %FILE% - Filename of original file
TEMPFILENAME="$(mktemp).mkv" # Temporary File for transcoding
/usr/bin/ffmpeg -y -i "$FILENAME" -map 0:0 -map 0:1 -vcodec copy -acodec copy -f matroska "$TEMPFILENAME"
mv -f "$TEMPFILENAME" "${FILENAME%.ts}.mkv"
version: '2'
services:
web:
image: nginx:latest
ports:
- "8080:80"
volumes:
- ./bin:/var/www/bin
- ./data:/var/www/data
@trollboy
trollboy / dice.php
Last active February 15, 2019 15:59
PHP dice roller class
<?php
/**
* Simple game dice rolling
* Emulates probability as closely as possible
* Feel free to comment/contribute/bughunt
*
* @author Matt Wiseman <trollboy@gmail.com>
*/
2014/02/26 23:18:01 [error] 99391#0: *766 kevent() reported about an closed connection (54: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /index.php HTTP/1.0", upstream: "http://127.0.0.1:80/index.php", host: "127.0.0.1"
<?php
$mybigarray = array(
array(
':keynameone'=>'Red',
':keyname2'=>'Orange',
':keyname3'=>'Yellow',
),
array(
':keynameone'=>NULL,
':keyname2'=>'Green',