Skip to content

Instantly share code, notes, and snippets.

View mkasberg's full-sized avatar

Mike Kasberg mkasberg

View GitHub Profile
@mkasberg
mkasberg / backup-with-rsync.sh
Last active April 23, 2020 02:49
A simple script to make backups with rsync easy!
#!/usr/bin/env bash
# A simple script to make backups with rsync easy!
# This will backup the entire home dir of the current user.
# (I always forget these commands.)
function print_usage {
cat << EOF
Usage: $0 [options]

Keybase proof

I hereby claim:

  • I am mkasberg on github.
  • I am mkasberg (https://keybase.io/mkasberg) on keybase.
  • I have a public key ASApuEY9bNVN-3fR7rfBoOwjBdVVJpPd9SmtCxCAst4gHQo

To claim this, I am signing this object:

@mkasberg
mkasberg / loundorm.py
Last active April 29, 2022 07:09 — forked from kylophone/loudness.rb
FFmpeg loudnorm filter - dual pass loudness normalization example - http://k.ylo.ph/2016/04/04/loudnorm.html
#!/usr/bin/env python
import json
import os
from subprocess import check_call, check_output, STDOUT
import sys
if len(sys.argv) != 3:
print "Usage: %s input.wav output.wav" % __file__
sys.exit(1)
@mkasberg
mkasberg / CustomLogger.php
Last active April 1, 2018 12:19
PHPUnit Hides Errors After set_error_handler() Called
<?php
class CustomLogger {
public function __construct() {
// Try commenting out this line:
set_error_handler(array($this, 'handleError'));
}
public function __desctruct() {
restore_error_handler();
@mkasberg
mkasberg / csv2json.php
Created January 21, 2017 02:46
Converts a CSV to JSON array based on CSV headings.
#!/usr/bin/env php
<?php
print "CSV 2 JSON\n";
if (!isset($argv[2])) {
print "Usage: csv2json.php infile.csv outfile.json\n";
exit();
}