Skip to content

Instantly share code, notes, and snippets.

View brejoc's full-sized avatar
🏡
Remote

Jochen Breuer brejoc

🏡
Remote
View GitHub Profile
@brejoc
brejoc / some.js
Created May 24, 2015 18:27
FancyBox2 and Bootstrap Carousel - You spin me round!
/*
With this afterLoad callback, the bootstrap gallery
switches pages with the current image displayed in
the FancyBox modal.
*/
$(".fancybox").fancybox({
loop : false,
afterLoad: function(current, previous) {
if(previous) {
var carouselItems = 6;

Auto-starting VirtualBox VMs on OS X

After finding a lot of other posts on the topic that didn't work out for me this one did the trick so I'm reposting for my own sense of self preservation.

Link to original article.

Copy the Virtualbox autostart plist template file to your system's LaunchDaemons folder.

sudo cp \

/Applications/VirtualBox.app/Contents/MacOS/org.virtualbox.vboxautostart.plist \

@brejoc
brejoc / plantumlwatchdog.py
Last active August 29, 2015 14:27
Quick and dirty (seriously) hack to recursively watch for .plantuml files to generate png images in that folder.
#!/usr/bin/python
"""\
Recursively watches for .plantuml files and generates png images in that folder.
Dependencies:
* watchdog
* sh
* plantuml.jar from plantuml.com
@brejoc
brejoc / timeout.py
Created March 29, 2016 13:38
Example of a with-statement that allows to define a timeout for code execution.
#!/usr/bin/env python
"""timeout.py: Example of a with-statement that allows to define a timeout for code execution."""
__author__ = "Jochen Breuer"
__license__ = "Public Domain"
__email__ = "brejoc@gmail.com"
import signal
from time import sleep
@brejoc
brejoc / grayscale.fish
Created March 31, 2016 12:30
fish shell script to convert all files in pwd to grayscale images
function grayscale -d "converts all files in pwd to grayscale images"
rm gray*
for file in (ls)
convert $file -colorspace Gray gray_$file
convert gray_$file -resize 130x130\> gray_$file
end
end
@brejoc
brejoc / terminal_color_scheme
Created December 13, 2016 14:53 — forked from OpenNingia/terminal_color_scheme
Simple script to apply Solarized color scheme to Pantheon Terminal
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Solarized theme for pantheon-terminal
see http://ethanschoonover.com/solarized
"""
import posixpath
import sys
from gi.repository import Gio
@brejoc
brejoc / Caddyfile
Created February 15, 2017 09:01 — forked from jpoehls/Caddyfile
Proxy + Static File serving with caddy
# Caddyfile
localhost:2015 {
startup "go run ./server.go" &
root ./static_files
proxy / localhost:2016
}
# FILE TREE
#
# Caddyfile
localhost:8001 {
gzip
errors visible
log stderr
rewrite /static {
r (.*)
to /path/to/static/{1}
@brejoc
brejoc / keybase.md
Created August 14, 2017 20:38
keybase.md

Keybase proof

I hereby claim:

  • I am brejoc on github.
  • I am brejoc (https://keybase.io/brejoc) on keybase.
  • I have a public key ASCFZ-9Y83c-HlfTD5Na5S42M9-uZUgnazH7mN2eRhMi7Ao

To claim this, I am signing this object:

@brejoc
brejoc / so_reuseport.py
Created November 12, 2017 21:50
Example for SO_REUSEPORT - Start multiple instances of this script and connect to them via shared port 8080: $ echo data | nc localhost 8080
#!/usr/bin/env python
"""
Example for SO_REUSEPORT
Usage:
Start multiple instances of this script and connect
to them via shared port 8080: $ echo data | nc localhost 8080
"""