Skip to content

Instantly share code, notes, and snippets.

@geetduggal
geetduggal / example.ledger
Last active February 26, 2024 07:34
Example ledger file
; TODO: Add retirement, other investments, house, etc
alias A=Assets
alias B=Assets:Banking
alias V=Assets:Investments
alias C=Liabilities:Credit
alias L=Liabilities
alias E=Expenses
alias I=Income
@geetduggal
geetduggal / dashboard.js
Created February 19, 2024 07:25
Financial Dashboard in Obsidian: Ledger + Dataview
// Code for https://medium.com/@geetduggal/the-power-of-obsidian-for-personal-finance-accounting-f00bbcb1b66f
// Step 1: SUPER shameful poor-man parsing of a ledger journal file
const ledgerFile = await dv.io.load("🔲 Spaces/💰 Finances/transactions.ledger.md")
let allTransactions = ledgerFile.split(/\n\n/).
filter((transactionText) => {
return !(transactionText.startsWith(";") || transactionText.startsWith("alias") || transactionText.match(/^\s*$/))
}).
map((transactionText) => {
import "bam_chrom_counter.wdl" as bcc
workflow scale_counter {
File bam
Int n
scatter (i in range(n)) {
call bcc.bam_chrom_counter {
input: bam = bam, i = i
}
workflow bam_chrom_counter {
File bam
Int i
call slice_bam {
input : bam = bam
}
scatter (slice in slice_bam.slices) {
call count_bam {
input: bam = slice
def python:
pass
bind-key -n S-Left swap-window -t -1
bind-key -n S-Right swap-window -t +1
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
locations:
- instance-1
- instance-2
- instance-3
jobs:
- {name: job-1, request-time: 0, start-time: 2, duration: 30, location: instance-1}
- {name: job-2, request-time: 1, start-time: 3, duration: 15, location: instance-2}
- {name: job-3, request-time: 10, start-time: 20, duration: 15, location: instance-2}
- {name: job-4, request-time: 5, start-time: 5, duration: 45, location: instance-3}
# A simple script to make a plot of jobs given a simple YAML file describing a scheduling of jobs at locations
# I have various variants of this to do more complex plotting at scale, but this contains the basics
# An example of the scheduling file is in job-schedule.yaml
import argparse
import pprint
import yaml
parser = argparse.ArgumentParser(description='Plots a schedule of jobs from a YAML input')
parser.add_argument('schedule', help='YAML file of job output')
@geetduggal
geetduggal / .vimrc
Last active September 3, 2023 21:56
" curl https://gist.githubusercontent.com/geetduggal/d9702695b96b13532a291d74f7a38e38/raw >> ~/.vimrc
syntax on
" Basic space and tab preferences
set ts=4
set sw=4
set expandtab
" Get rid of typically undesirable whitespace
if has("autocmd")
@geetduggal
geetduggal / .bashrc
Last active February 10, 2017 22:24
# Append to new system bashrc
# curl https://gist.githubusercontent.com/geetduggal/830cda2cf406601833fce50dacbf54a5/raw >> ~/.bashrc
# A more VI experience within bash
export EDITOR=vi
set -o vi
# Allow grep to preserve colors even when piping into less
alias grep='grep --color=always'
alias less='less -r'