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 / 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 / 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 / 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

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 / 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;