Skip to content

Instantly share code, notes, and snippets.

@nonducor
nonducor / pywrap.py
Last active August 28, 2022 14:13
A simple set of classes that wraps a dictionary or list and allows acessing the elements of the dicitonary as if they were attributes of the class. Answer to this question in stackoverflow: https://stackoverflow.com/questions/72630875/python-json-finding-elements-on-a-dynamic-path/72665554#72665554
# The MIT License (MIT)
#
# Copyright (c) 2022 Rodrigo Rizzi Starr
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@nonducor
nonducor / clocktable-by-tag.el
Last active December 18, 2023 20:59 — forked from ironchicken/clocktable-by-tag.el
Emacs org-mode dynamic block similar to clocktable, but grouped by tag. See: https://stackoverflow.com/questions/70568361/org-mode-review-clocked-time-by-multiple-tags
(require 'org-clock)
(defun clocktable-by-tag/shift-cell (n)
(let ((str ""))
(dotimes (i n)
(setq str (concat str "| ")))
str))
(defun clocktable-by-tag/insert-tag (files params)
(let ((tag (plist-get params :tags))
@nonducor
nonducor / gcash2ledger.py
Last active September 12, 2023 06:10
A simple script to convert an (uncompressed) gnucash XML file to the ledger-cli format
#! /usr/bin/python3
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# (1) Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright