Skip to content

Instantly share code, notes, and snippets.

@wbsch
wbsch / on-add_interactivity.py
Created March 21, 2015 21:22
Proof of concept for an interactive Taskwarrior hook. Hackish and potentially problematic, but it works.
#!/usr/bin/env python
#
# PoC: Interactive on-add hook
import json
import sys
t = json.loads(sys.stdin.readline())
real_stdin = open("/dev/tty", "r")
##############################################################################
#
# 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
@wbsch
wbsch / on-add_inline_tags.py
Last active September 4, 2015 05:53
Proof of concept for a Taskwarrior on-add hook that allows for "inline tags" when adding tasks
#!/usr/bin/env python
#
# PoC for "inline tags", as described in TW-1357
# https://bug.tasktools.org/browse/TW-1357
#
# Turns
# $ task add I saw @bob in the @garden
# Into the equivalent of
# $ task add I saw bob in the garden +bob +garden
@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%
@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 | | | |
| | | | |
| | | | |
@linuxcaffe
linuxcaffe / on-exit_git.py
Created November 24, 2016 05:41 — forked from wbsch/on-exit_git.py
Proof of concept for a Taskwarrior on-exit hook that manages a git repository in ~/.task
#!/usr/bin/env python
#
# PoC: Manage a git repository in ~/.task that gets updated on changes.
# Only pending.data and completed.data are included by default.
# You can use "git add" to add whatever files you want to track in your
# task folder.
#
# Inspired by https://gist.github.com/Unode/9366218
#
# Works with any Taskwarrior version that supports hooks.
@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):
#!/usr/bin/env python3
#
# Save as on-add_annotate.py in hooks directory, then:
# $ chmod +x ~/.task/hooks/on-add_annotate.py
#
# Anything after "annotate:" in a new task's description is added as an
# annotation:
# $ task add this is the description annotate:this is an annotation
import json
@wbsch
wbsch / on-exit_git.py
Last active November 16, 2020 15:33
Proof of concept for a Taskwarrior on-exit hook that manages a git repository in ~/.task
#!/usr/bin/env python
#
# PoC: Manage a git repository in ~/.task that gets updated on changes.
# Only pending.data and completed.data are included by default.
# You can use "git add" to add whatever files you want to track in your
# task folder.
#
# Inspired by https://gist.github.com/Unode/9366218
#
# Works with any Taskwarrior version that supports hooks.
@chriscz
chriscz / timewn.py
Last active January 6, 2021 02:35
A python script to notify you of your current TimeWarrior task
#!/usr/bin/env python
# Notifies the user of the curently active TimeWarrior task every m minutes (default 10min).
# Requirements
# - python 2.7
# - pynotify
# Usage:
# python timewn.py [optional seconds]
import sys
import pynotify