Skip to content

Instantly share code, notes, and snippets.

@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.
@simonmichael
simonmichael / .bashrc.task
Last active January 18, 2022 17:55
taskwarrior config 2016/01
# Simon's taskwarrior aliases
########################################
# general commands
alias t="task"
alias ta="task add"
alias td="task done"
alias t-="task delete"
alias tm="task modify"
@chriscz
chriscz / filemonitor.py
Last active April 8, 2022 15:20
Python snippet for monitoring where files were opened
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@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:
@simonmichael
simonmichael / envelope-budgeting.journal
Last active October 15, 2023 08:12
envelope budgeting example
; An example of YNAB-ish envelope budgetting with hledger/ledger
; cf https://github.com/simonmichael/hledger/issues/315
; Using accounts like the following:
;
; assets
; business
; bank
; wf
; bchecking
@enpassant
enpassant / vimwiki2html.md
Last active November 15, 2023 01:04
Convert VimWiki to HTML (markdown, mediawiki)

With this wiki2html.sh bash script and pandoc program, you can convert markdown to html.

Usage: In the vim list section of the .vimrcfile, include options:

let g:vimwiki_list = [{'path': ‘your_wiki_place',
  \ 'path_html': ‘wiki_html_location’,
  \ 'syntax': 'markdown',
 \ 'ext': '.md',
@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
@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