Skip to content

Instantly share code, notes, and snippets.

@protist
protist / vimwiki-tree
Created Mar 9, 2015
Create a linkified vimwiki tree of the specified directory and subdirectories
View vimwiki-tree
#!/usr/bin/env bash
# Create a linkified vimwiki tree of the specified directory and subdirectories.
# It takes one argument: the base directory of the vimwiki.
# For the links to make sense, place the output of this script into a file located in this base directory.
# Print header
echo '= Wiki contents ='
echo
cd "$1"
@wbsch
wbsch / on-modify.blocks_attr.py
Last active Apr 8, 2021
Taskwarrior hook script that adds a "blocks:" pseudo-attribute for adding/modifying tasks.
View on-modify.blocks_attr.py
#!/usr/bin/env python
#
# Adds the ability to add / modify tasks using a "blocks:" attribute,
# the opposite of "depends:".
#
# This script acts as an on-modify, on-add and on-launch hook at the same time.
#
### SETUP
# Save this file as
# ~/.task/hooks/on-modify.blocks_attr.py
@wbsch
wbsch / on-modify.timetrack.py
Last active Nov 12, 2020
Time tracking hook script for Taskwarrior that outputs ledger timelog formatted data.
View on-modify.timetrack.py
#!/usr/bin/env python
#
# Writes task start/stop times to a timelog formatted file.
# You might need to adjust LEDGERFILE, or set the TIMELOG environment variable.
#
# Example reports, after using start/stop on a task:
# ledger -f /path/to/timelog.ledger print
# ledger -f /path/to/timelog.ledger register
#
# Projects, tags, and UUIDs are fully supported and queryable from ledger.
@tmalsburg
tmalsburg / vcard2org-contacts.py
Last active Mar 4, 2020
A simple script for converting vCard files to org-contacts.
View vcard2org-contacts.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Written by Titus von der Malsburg <malsburg@posteo.de>, March 2014.
# This is a simple script for converting vCard files to
# org-contacts. There is one mandatory argument: the name of the
# vCard file. The result is printed to standard out.
# Usage:
@linuxcaffe
linuxcaffe / gist:7201127
Last active Dec 26, 2015
ultimate vim-taskwarrior window split madness
View gist:7201127
here it is with everything open
_______________________________________________________
|ID_Age_D_P_Project_Description______|__R__|__P__|__T__|
| | | | |
| | | | |
| | | | |
| L | | | |
| | | | |
| | | | |
@simonmichael
simonmichael / templates.journal
Last active Dec 15, 2015
hledger journal entry template experiments
View templates.journal
; experimental hledger journal entry templates for some common transactions
; These are sketches, don't expect them to be sensible.
; A few different events are noted:
; accrued = when the revenue was earned
; invoiced = when the invoice was sent
; received = when the check was received
; deposited = when the check was deposited
; reported = the revenue's date for taxing ("taxable moment")
; us tax = estimated federal tax, 25%
@yin8086
yin8086 / parseVCard.py
Last active Oct 13, 2015
VCard process to get the person who has phone numbers
View parseVCard.py
# -*- coding: utf-8 -*-
import vobject, sys, codecs
from os import path
def hasTel(lineList):
for line in lineList:
if line[:len('TEL;')] == 'TEL;':
return True
return False
@wbsch
wbsch / taskwarrior_xmpp_bot.py
Created Nov 19, 2012
taskwarrior <---> XMPP bridge in python. Proof of concept, no error checking :)
View taskwarrior_xmpp_bot.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sleekxmpp
import subprocess
import time
class TWBot(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, whitelist):
View gist:242321
##############################################################################
#
# Copyright (c) 2003 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE