Skip to content

Instantly share code, notes, and snippets.

View tricoder42's full-sized avatar
🕴️
I may be slow to respond.

tricoder42

🕴️
I may be slow to respond.
View GitHub Profile
@tricoder42
tricoder42 / osx_boot2docker
Created August 14, 2014 17:28
Helper script to install boot2docker with added guest additions.
#!/bin/bash
# Helper script to install boot2docker with added guest additions
# Directory /Users will be mounted as shared dir.
#
# Source:
# https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c
BOOT2DOCKER_PATH=~/.boot2docker/boot2docker.iso
RELEASE=http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso
RELEASE_MD5=5e39eb7e960e30b433ffefb02bfce4ba
@tricoder42
tricoder42 / urls.py
Created June 11, 2013 06:10
Snippet to server static and media files in development.
# Append to your urls.py file.
# Development
from django.conf import settings
if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
media = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns = media + staticfiles_urlpatterns() + urlpatterns
@tricoder42
tricoder42 / twilight.py
Last active November 6, 2017 13:09
Show times for dusk, dawn, sunset and sunrise.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Usage: twilight.py [--city=<city> | --coordinates=<coordinates>]
[--date=<date> | --tomorrow] [--week]
[-h | --help | --version]
Options:
-h --help Show this help.
--version Show version.
@tricoder42
tricoder42 / gist:3969491
Created October 28, 2012 19:06
Show song info from internet radio in pop up using mplayer and notify-send
#!/bin/sh
# Show song info from internet radio in pop up window.
#
# Copyright (c) 2012 Tomáš Ehrlich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell