Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -e
set -u
mkdir -p ~/bin
GIT_WORK_TREE=~/bin git checkout -f
GIT_SHA=$(git rev-parse --short HEAD)
echo "DATE: $(date)"
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
@tanelpuhu
tanelpuhu / PrefixLogger.py
Last active September 22, 2015 20:07
like that??
import logging
import contextlib
class PrefixLogger(logging.getLoggerClass()):
_prefix = []
@contextlib.contextmanager
def prefix_context(self, prefix):
self._prefix.append(prefix)
#!/usr/bin/env python
# coding=utf-8
import pickle
import zlib
from werkzeug._compat import integer_types
from werkzeug.contrib.cache import RedisCache
class ZRedisCache(RedisCache):
#!/usr/bin/env python
import argparse
import socket
COLORS = [
'white',
'red',
'orange',
'yellow',
// track in title on play.pocketcasts.com
var doc_title = document.title,
intr = function() {
var title = $('.player_podcast_title:first').text(),
remaining = $('.remaining_time:first').text(),
current = $('.current_time:first').text();
if(title && remaining && current) {
document.title = remaining + ' : ' + title + ' : ' + doc_title;
} else {
document.title = doc_title;
#
# Bash completion for fabric
#
function _fab_complete() {
local cur
if [[ -f "fabfile.py" || -d "fabfile" ]]; then
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
Verifying myself: My Bitcoin username is +tanel. https://onename.io/tanel