Skip to content

Instantly share code, notes, and snippets.

View markusfisch's full-sized avatar

Markus Fisch markusfisch

View GitHub Profile
@markusfisch
markusfisch / timelapse.sh
Created October 28, 2014 19:41
Create a timelapse with ImageMagick and MEncoder
#!/usr/bin/env bash
# Create timelapse. Stop recording with any key.
# Requires ImageMagick (Linux only) and MPlayer's MEncoder.
#
# @param 1 - interval in seconds (optional, default is 1)
timelapse()
{
local CAPTURE=
@markusfisch
markusfisch / README.md
Last active February 23, 2022 13:37
Convert Markdown files to simple web presentations

Markdown To Takahashi Presentation

[BASH][bash] script to create a single file [Takahashi][takahashi] web presentation from a [Markdown][markdown] document.

Dependencies

You'll need a [Markdown][markdown] converter named markdown in your

@markusfisch
markusfisch / README.md
Created July 28, 2014 11:03
Format strings into a expanding buffer

sbprintf

Format strings into a expanding buffer.

Sample

struct sbprintf_string_buffer sb = { NULL, NULL, 0 };
@markusfisch
markusfisch / README.md
Last active August 29, 2015 14:04
Encode UTF-8 strings to be used with XML

entity

Encode UTF-8 strings to be used with XML.

Converts "Tästø÷…" into "Tästø÷…".

Quick sample:

#include "entity.h"
@markusfisch
markusfisch / README.md
Last active March 15, 2020 11:28
Quick and dirty SQL Web Console for PHP

SQL Web Console

A quick and dirty SQL web console for PHP5+.

Please don't use this in production!

Use this as a quick drop-in to access your web site's database when you can't use SSH (e.g. when you're in a corporate network that blocks SSH. Yes, I know, that's totally braindead and every IT staff doing so should

@markusfisch
markusfisch / .piedockrc
Last active November 21, 2016 09:54
PieDock resource configuration for Ubuntu
size 320
fitts 1
title 1
font Sans 8.0
compositing 1
ignore-mask Num_Lock
@markusfisch
markusfisch / workspace.sh
Created May 16, 2014 07:27
bash script to easily switch to next workspace in Ubuntu compbiz using wmctrl
#!/usr/bin/env bash
# Switch to next viewport
next_viewport()
{
if (( X+VIEWPORT_WIDTH >= TOTAL_WIDTH ))
then
X=0
if (( Y+VIEWPORT_HEIGHT >= TOTAL_HEIGHT ))
@markusfisch
markusfisch / README.md
Last active November 2, 2023 10:49
Force any binary to use a specific network interface in Linux

setnif

Force any binary to use a specific network interface.

Requires gcc and bash. Linux only.

Usage:

$ sudo ./setnif.sh eth1 curl www.google.com
@markusfisch
markusfisch / readkey.sh
Last active January 15, 2016 17:26
Read a key from stdin in bash
#!/usr/bin/env bash
# Process literal key
process_literal_key()
{
case "$REPLY" in
$'\E')
ESCAPE=1
;;
'')
@markusfisch
markusfisch / .vimrc
Created May 8, 2014 08:24
Put this in your .vimrc to easily switch between tabs (F5) and spaces (F6) and highlight improper indent
" Use Tabs
function! UseTabs()
" Highlight tabs within lines, trailing whitespace and
" spaces at the beginning of lines
match errorMsg /[^\t]\zs\t\+\|\s\+$\|^[\t]*[ ]\+[\t]*[^\*]/
set noexpandtab
endfunc
nnoremap <F5> :call UseTabs()<CR>
" Use Spaces