Skip to content

Instantly share code, notes, and snippets.

@ghl3
ghl3 / Makefile
Created November 29, 2012 14:26
Makefile for python unittest
RUNTEST=python -m unittest -v -b
ALLMODULES=$(patsubst %.py, %, $(wildcard test_*.py))
all:
${RUNTEST} ${ALLMODULES}
% : test_%.py
${RUNTEST} test_$@
@will-hart
will-hart / plugin.py
Created July 1, 2013 09:36
A simple python plugin system using a custom metaclass
# a simple Python plugin loading system
# see http://stackoverflow.com/questions/14510286/plugin-architecture-plugin-manager-vs-inspecting-from-plugins-import
class PluginMount(type):
"""
A plugin mount point derived from:
http://martyalchin.com/2008/jan/10/simple-plugin-framework/
Acts as a metaclass which creates anything inheriting from Plugin
"""
@jpetitcolas
jpetitcolas / gist:5967887
Created July 10, 2013 16:37
Encode/decode a base64 encoded string in PostGreSQL
-- Decoding
SELECT CONVERT_FROM(DECODE(field, 'BASE64'), 'UTF-8') FROM table;
-- Encoding
SELECT ENCODE(CONVERT_TO(field, 'UTF-8'), 'base64') FROM table;
@schwuk
schwuk / plexmediaserver
Created August 29, 2013 10:24
UFW Application Profile for Plex Media Server
[plexmediaserver]
title=Plex Media Server
description=The Plex Media Server is smart software that makes playing Movies, TV Shows and other media on your computer simple
ports=32400/tcp|1900/udp|32469/udp|5353/udp
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@m1ari
m1ari / RPI Streaming notes
Last active January 20, 2023 13:32
Stream raspberry pi camera over multicast and cope with raspivid exiting
This requires a couple of windows (or a screen/tmux session)
First create a fifo to use
mkfifo video.h264
In the first window start raspivid in the following way
while true; do raspivid -n -vf -hf -w 460 -h 270 -b 512000 -t 36000000 -o video.h264 -v; done
In the second window start vlc like:
cvlc video.h264 --sout "#duplicate{dst=std{access=udp,mux=ts,dst=239.255.1.2:1234}}" :demux=h264 --ttl 4 -I http --sout-keep -v --loop
@prwhite
prwhite / Makefile
Last active June 11, 2024 13:48
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@XVilka
XVilka / TrueColour.md
Last active June 10, 2024 17:21
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@pascalpoitras
pascalpoitras / config.md
Last active June 6, 2024 13:09
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 1, 2024 23:17
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook