This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
# $Id: mutt2remember.pl,v 1.5 2008/09/27 11:25:41 friedel Exp friedel $ | |
# Variations on a theme given by Russell Adams http://lists.gnu.org/archive/html/emacs-orgmode/2008-09/msg00300.html | |
$ENV{TMPDIR} = $ENV{TMP}; | |
# Install: | |
# ======== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package elpy | |
:config | |
(progn (elpy-enable) | |
(defun elpy-nose-test-spec (module test) | |
(cond (test | |
(format "%s:%s" module test)) | |
(module module) | |
(t ""))) | |
(defun elpy-test-nose-pdb-runner (top file module test) | |
"Test the project using the nose test runner with the --pdb arg. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import distutils.spawn | |
import os | |
import re | |
import socket | |
import subprocess | |
import xcffib.xproto | |
from libqtile import layout, bar, widget, hook | |
from libqtile.command import lazy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; from http://www.emacswiki.org/emacs/ToggleWindowSplit (last example as of 2015-02-19) | |
(defun window-toggle-split-direction () | |
"Switch window split from horizontally to vertically, or vice versa. | |
i.e. change right window to bottom, or change bottom window to right." | |
(interactive) | |
(require 'windmove) | |
(let ((done)) | |
(dolist (dirs '((right . down) (down . right))) | |
(unless done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application/ms-tnef; tnefsmime %s; copiousoutput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import db | |
import gc | |
# from https://djangosnippets.org/snippets/1949/ | |
def queryset_iterator(queryset, chunksize=1000): | |
''''' | |
Iterate over a Django Queryset ordered by the primary key | |
This method loads a maximum of chunksize (default: 1000) rows in it's | |
memory at the same time while django normally would load all rows in it's | |
memory. Using the iterator() method only causes it to not preload all the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# adapted from https://gist.github.com/iMilnb/75d65d88ce649b1f191a | |
import ConfigParser | |
import mechanize | |
import os | |
CONFIG = os.environ.get('SPAMCOP_CONFIG', | |
os.path.expanduser('~/secret/spamcop-config.ini')) | |
config = ConfigParser.SafeConfigParser() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Archiv nur Buxtehuder Tageblatt | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @download https://gist.githubusercontent.com/TauPan/9b723469c2893fbefaff4cbe9845e34e/raw/tageblatt-archiv-buxtehude.js | |
// @description Begrenzt die Archivansicht beim tageblatt.de E-Paper auf Buxtehuder Tageblatt | |
// @author Friedrich Delgado <[email protected]> | |
// @match http://www.tageblatt.de/index.php?pageid=573 | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://gist.github.com/asfaltboy/b3e6f9b5d95af8ba2cc46f2ba6eae5e2 | |
# based on https://gist.github.com/blueyed/4fb0a807104551f103e6 | |
from django.db import connection | |
from django.db.migrations.executor import MigrationExecutor | |
from django.core.management import call_command | |
import pytest | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
update_command='reset; while pgrep -f apt-get; do echo -n "O"; sleep 60; done;aptitude update; aptitude -y -d safe-upgrade --full-resolver; aptitude safe-upgrade --full-resolver; purge-old-kernels ; cat /var/run/reboot-required*' | |
reachable () { | |
netcat -w 1 -z $* | |
} | |
hosts='dirk thomas abrasax orion' | |
sudo wakeonlan -f /etc/wakeonlan/abrasax.wol |