Skip to content

Instantly share code, notes, and snippets.

reverse-engineering assumptions from code

Sander van Dragt svandragt

reverse-engineering assumptions from code
View GitHub Profile
svandragt / composer.json
Last active Dec 12, 2019
Replace plugin with non-packagist composer version, in custom location.
View composer.json
"repositories": [
"type": "vcs",
"url": ""
"require": {
"oomphinc/composer-installers-extender": "^1.1",
"fusioneng/shortcake": "dev-master#0.7.4"
svandragt / .bashrc
Last active Oct 29, 2019
Git Helper
View .bashrc
alias git-create=" $1 $2"
svandragt /
Last active Oct 23, 2019
Convert (Instapaper) CSV to Netscape Bookmark File
#!/usr/bin/env python
Convert CSV to Netscape Bookmark File
Works for files exported by Instapaper.
author: Sander van Dragt <>
version: 2019-10-23.01
import csv
from sys import argv
svandragt /
Last active Jan 26, 2022 — forked from jazzsequence/
How I Like to Work posts (2021-06)

How I work

This is my own interpretation of how I like to work, feedback welcome! If this doesn't match your experience of how I like to work, let me know! ;)

When I work

I'm almost always in the UK. I operate from the BST/GMT timezone ( I follow a 9am-5pm working hours format, this is best for my family. Occasionally I might take a nap and work late to compensate.

I tend to work 7 hours a day with ideally the first hour of the day for admin. Meetings are best in the morning as it takes me time to get into the groove, so I do my best work in the afternoon.

Where I work

I work from home. My dog might walk in on our meeting!

svandragt /
Last active Aug 26, 2019
Known CMS upgrade automation (
#!/usr/bin/env bash
rm -rf old
cp -R html old
pushd html
git stash
git pull
composer update
cd ..
ln -sf `pwd`/config.ini `pwd`/html/config.ini
ln -sf `pwd`/Uploads `pwd`/html/Uploads
svandragt / variety-of-files.php
Last active Jul 10, 2019
WordPress Theme Feature Setup
View variety-of-files.php
// mu-plugins/theme-features.php
require_once( FEATURES_DIR . '/myfeature.php' );
// mu-plugins/theme-features/myfeature.php
function features_myfeature_init() {
if ( current_theme_supports( 'myfeature' ) ) {
add_action( 'some_hook', 'features_myfeature' );
svandragt /
Last active May 6, 2019
Upload latest screenshot in ~/Pictures and notify URL and send to clipboard
# v1 - 2019-05-06
# Upload latest screenshot in ~/Pictures and notify URL and send to clipboard
# requires a domain to upload; xclip to send to clipboard; and gnome to notify.
FILE=$(ls -t ~/Pictures/Screenshot*.png | head -1)
if [ ! -z "$FILE" ]; then
HASH=$(md5sum "$FILE"| head -n1 | awk '{print $1;}')
mv "$FILE" "/tmp/${HASH}.png"
svandragt / notes-to-evernote-migration.scpt
Last active Apr 7, 2019
Migrate Apple Notes to EverNote
View notes-to-evernote-migration.scpt
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
Create a folder in Apple Notes called Exported
Create a folder in Evernote called Imported
Then for each folder set the variable to the name of the folder
Known issues: doesn't copy images, scanned documents and embedded links (it's html).
Workaround: select note contents, copy and paste into Evernote. Scanned documents can be exported to PDF and dragged into EverNote.
svandragt /
Created Sep 24, 2018
Bash variable scope
export SURNAME='Bob'
svandragt /
Created Jun 12, 2018
Unzip long filenames
if (( $# == 0 )); then
echo "$0"
exit 1
fbase=$(basename "$1")
mkdir "$fdir"