Skip to content

Instantly share code, notes, and snippets.

View dtcooper's full-sized avatar
👻
Boo!

David Cooper dtcooper

👻
Boo!
View GitHub Profile
@dtcooper
dtcooper / argon_one.md
Last active March 23, 2024 16:44
Argon One Raspberry Pi Case
diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp
index 2db37b58..b4f90c72 100644
--- a/UI/obs-app.cpp
+++ b/UI/obs-app.cpp
@@ -1981,6 +1981,8 @@ int main(int argc, char *argv[])
move_to_xdg();
#endif
+ obs_set_cmdline_args(argc, argv);
+
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $(basename "$0") input.wav [input.wav] [...]"
exit 0
fi
red () {
echo "\x1B[91m$1\x1B[0m"
}
@dtcooper
dtcooper / install_liquidsoap_latest.sh
Last active January 3, 2020 15:35
Various Liquidsoap Install Scripts for Ubuntu 16.04 LTS
#!/bin/sh
sudo apt-get install -y build-essential git automake
mkdir -p "$HOME/liquidsoap-build"
cd "$HOME/liquidsoap-build"
wget https://github.com/savonet/liquidsoap/releases/download/1.3.0/liquidsoap-1.3.0-full.tar.gz
tar xvzf liquidsoap-1.3.0-full.tar.gz
@dtcooper
dtcooper / sonos_now_playing.py
Last active February 17, 2017 22:25
Checks what's playing on a sonos device. Useful to run in liquidsoap on a timer to figure out what the hell it's playing.
#!/bin/sh
"exec" "`dirname $0`/bin/python" "$0" "$@"
import sys
import argparse
import soco
class NowPlayingInfo(object):
@dtcooper
dtcooper / gist:7088747
Last active December 26, 2015 03:49
Conditionally run an ALTER
/* Emulate an IF EXISTS for ALTER TABLE ... DROP COLUMN */
SELECT COUNT(*) INTO @exists FROM `information_schema`.`COLUMNS`
WHERE `TABLE_SCHEMA` = DATABASE()
AND `COLUMN_NAME` = 'link_type'
AND `TABLE_NAME` = 'Social_Identity';
SET @query = IF(
@exists = 1,
'ALTER TABLE `Social_Identity` DROP COLUMN `link_type`',
@dtcooper
dtcooper / pep8_tests.py
Created November 5, 2012 19:39
Django PEP8 Test Generator Example
import os
import re
import subprocess
from django.conf import settings
from django import test
class PEP8Tests(test.TestCase):
def _generate_pep8_tests(class_namespace):
@dtcooper
dtcooper / gist:1346300
Created November 7, 2011 21:47
Conditional decorator to escape strings
from functools import wraps
from django.utils.safestring import mark_safe
def raw_html(func_or_str):
'''
Call me a string or decorator a function with me to output HTML in your template.
'''
if callable(func_or_str):