Skip to content

Instantly share code, notes, and snippets.

View franz-josef-kaiser's full-sized avatar

Franz Josef Kaiser franz-josef-kaiser

View GitHub Profile

Keybase proof

I hereby claim:

  • I am franz-josef-kaiser on github.
  • I am wecodemore (https://keybase.io/wecodemore) on keybase.
  • I have a public key whose fingerprint is 28BE F577 7D40 8B11 E67A 0998 0254 B1D9 3645 9541

To claim this, I am signing this object:

@franz-josef-kaiser
franz-josef-kaiser / terminal.md
Last active September 17, 2016 17:37
Useful terminal commands

OS X

Adding and Removing a Printer

This is done via the lpadmin command. To add a printer, use this format:

lpadmin -p Printer_Name -L "Printer Location" -E -v lpd://x.x.x.x 
 -P /Library/Printers/PPDs/Contents/Resources/en.lproj/Printer_Driver.gz
@franz-josef-kaiser
franz-josef-kaiser / .bash_prompt.sh
Created September 2, 2016 23:17 — forked from miki725/.bash_prompt.sh
Custom bash prompt which displays: (virtualenv) user:/path (git-branch)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@franz-josef-kaiser
franz-josef-kaiser / create_labels.sh
Created August 24, 2016 20:01 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
@franz-josef-kaiser
franz-josef-kaiser / docker-volume-rm.sh
Created April 9, 2016 14:06
Bulk Remove Docker Volumes
docker volume rm $( docker volume ls | awk '{print $2}' )
@franz-josef-kaiser
franz-josef-kaiser / formdatai-iterator.html
Last active March 2, 2017 10:09
JavaScript iterator garden – NodeIterator: a poor mans HTML scraper – FormIterator: a smart mans request data extractor
<form name="test" id="form-id">
<label for="name">Name</label>
<input name="name" id="name" type="text">
<label for="pass">Password</label>
<input name="pass" id="pass" type="text">
</form>
<script>
var it = new FormData( document.getElementById('form-id') ).entries();
var current = {};
@franz-josef-kaiser
franz-josef-kaiser / docker-compose.sh
Last active March 11, 2016 04:25
Docker and Docker-Compose tricks – nginx
# *CASE:*
# Debug start up problems by appending logs to `up` job
[1 (master *) ~/projects/DockerCompose] docker-compose up -d && docker-compose logs
# *Example* output:
[2 (master *) ~/projects/DockerCompose]: docker-compose up -d && docker-compose logs
web is up-to-date
logs is up-to-date
Creating nginx
Attaching to nginx, logs, web
@franz-josef-kaiser
franz-josef-kaiser / preferences.txt
Last active January 4, 2016 16:53
The original pcDuino update bash / shell script that must be shipped alongside the .img file on your SD card
# File resides in: /home/ubuntu/.arduino15/preferences.txt
# (remove this comment)
board=pcduino
browser=mozilla
browser.linux=mozilla
build.warn_data_percentage=75
console=true
console.auto_clear=true
console.error.file=stderr.txt
@franz-josef-kaiser
franz-josef-kaiser / 3vs4.md
Last active July 13, 2022 08:37
PHP Regex vs. DOMDocument
<?php
/** Plugin Name: (dev) Replace mail domains with 'example.com' */
add_filter( 'wp_mail_content_type', function( $content_type )
{
return 'this' === 'that'
? $content_type
: 'dragons';
}, 20 );