Skip to content

Instantly share code, notes, and snippets.


Kevin Gustavson kgust

  • Vanderbilt University Medical Center
  • Nashville, Tennessee USA
View GitHub Profile
View closest.php
// input misspelled word
$input = 'carrrot';
// array of words to check against
$words = array('apple','pineapple','banana','orange',
// no shortest distance found, yet
$shortest = -1;
kgust /
Created Dec 4, 2018 — forked from a7madgamal/
Dark mode for Slack on MacOS
  1. Close slack
  2. Open this file /Applications/
  3. Append this to it
document.addEventListener('DOMContentLoaded', function() {
   url: '',
   success: function(css) {
kgust /
Created Nov 29, 2018 — forked from VeryStrongFingers/
PHPStorm - PHP-PHPDBG Interpreter proxy
#### Dirty/Fake PHP Interpreter to trick PHPStorm into using PHPDBG for running tests with/without code coverage
## For Mac/Linux only, Window's ubuntu subsystem theoretically would work too
## Related JetBrain's issues/feature requests
kgust / 00
Last active Aug 29, 2018
All Things PlantUML
View 00

This is the best resource for PlantUML details.

Important Points

When you add the PlantUML plugin to PHPStorm, it creates a number of UML* template files that are examples that you can edit.

PlantUML can be generated by programs. E.g. php-plantumlwriter) It's even simple enough that we can write our own programs to generate PlantUML for our own use.

View docker-nginx-fastcgi.conf
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
kgust / box.json.dist
Created Aug 15, 2018
Can we create a PHAR of our application using box?
View box.json.dist
"chmod": "0755",
"main": "app/console",
"output": "console.phar",
"directories": ["src"],
"finder": [
"name": "*.php",
"exclude": ["test", "tests", "Tests"],
kgust / Caddyfile
Created Aug 15, 2018
Playing with Docker dynamic frontend servers
View Caddyfile {
fastcgi / php {
root /app001/www/irb
index web/app_dev.php
localhost:8000 {
root /Users/gustavkd/
kgust / benchmark.php
Created Aug 15, 2018
I wanted to benchmark functional PHP vs loops...
View benchmark.php
PHP Benchmark
Downloaded from:
class benchmark
kgust / build.xml
Created Aug 15, 2018
Phing Build Script (replace with bash script)
View build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="DISCOVR-e" default="full-build">
<property name="basedir" value="."/>
<!-- Use this when the tools are managed by Composer in ${basedir}/vendor/bin -->
<property name="pdepend" value="${basedir}/bin/pdepend"/>
<property name="phpcpd" value="${basedir}/bin/phpcpd"/>
<property name="phpcs" value="${basedir}/bin/phpcs"/>
<property name="phpdox" value="${basedir}/bin/phpdox"/>
<property name="phploc" value="${basedir}/bin/phploc"/>
<property name="phpmd" value="${basedir}/bin/phpmd"/>
kgust / cs_fixer.php
Last active Jun 17, 2020
Configurations for php-cs-fixer (we are using phpcs and phpcbf instead)
View cs_fixer.php
$finder = PhpCsFixer\Finder::create()