Skip to content

Instantly share code, notes, and snippets.

@protist
protist / vimwiki-tree
Created March 9, 2015 10:47
Create a linkified vimwiki tree of the specified directory and subdirectories
#!/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 February 21, 2024 19:03
Taskwarrior hook script that adds a "blocks:" pseudo-attribute for adding/modifying tasks.
#!/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 November 10, 2021 21:17
Time tracking hook script for Taskwarrior that outputs ledger timelog formatted data.
#!/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 August 13, 2023 00:02
A simple script for converting vCard files to org-contacts.
#!/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 December 26, 2015 19:28
ultimate vim-taskwarrior window split madness
here it is with everything open
_______________________________________________________
|ID_Age_D_P_Project_Description______|__R__|__P__|__T__|
| | | | |
| | | | |
| | | | |
| L | | | |
| | | | |
| | | | |
@simonmichael
simonmichael / templates.journal
Last active December 15, 2015 07:19
hledger journal entry template experiments
; 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 November 18, 2023 04:46
VCard process to get the person who has phone numbers
# -*- 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 November 19, 2012 08:25
taskwarrior <---> XMPP bridge in python. Proof of concept, no error checking :)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sleekxmpp
import subprocess
import time
class TWBot(sleekxmpp.ClientXMPP):
def __init__(self, jid, password, whitelist):
##############################################################################
#
# 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