Skip to content

Instantly share code, notes, and snippets.

View jornane's full-sized avatar
:octocat:
Enjoying sr.ht

Jørn Åne de Jong jornane

:octocat:
Enjoying sr.ht
View GitHub Profile
#!/bin/sh
find ~/Documents/Textual\ Logs -type f -name \*.txt | while read file
do
test -z "$(grep -v '————————————— Begin Session —————————————' "$file" | grep -v '————————————— End Session —————————————' | grep -v '^ $' )" && rm "$file"
done
@jornane
jornane / _autoload.php
Last active November 10, 2015 12:49
Activate the native C SPL autoloader as included in PHP since PHP 5.1.2. Put this file in your namespace root and make sure it gets included from your PHP entry-point.
<?php
/*
* Copyright (c) 2014-2015, Jørn Åne de Jong <@jornane>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES