Skip to content

Instantly share code, notes, and snippets.

' Increment / Decrement selected cell's value by 1 (works on dates as well)
' Assign Keys alt+, and alt+. to macros via Tools>Customize>Keyboard-Tab search for category application macros>mymacros>standard>Module1
Sub activecellplus1
ThisComponent.CurrentSelection.value = ThisComponent.CurrentSelection.value +1
End Sub
@atcw
atcw / gist:11a7a9be297f1b5b633252e6b04286db
Created January 2, 2023 01:09
LibreOffice Calc Basic Macro Function for use as Formula to get First Day of a given ISO(no american) Weeknumber
Function MondayOfIsoWeek(Year_, WeekNum_) as long
'MondayOfIsoWeek = DATE(Year_ ;1;1) + IF(WEEKDAY(DATE(Year_;1;1);2)<5; (WeekNum_-1)*7;WeekNum_*7) - WEEKDAY(DATE(Year_;1;1);2)+1
Dim oService As Object
Set oService = createUnoService("com.sun.star.sheet.FunctionAccess")
'' Always use the function name in English
dim date1 as long
date1 = oService.callFunction("DATE", Array(Year_,1,1))
@atcw
atcw / on-exit-sync.py
Created August 17, 2019 20:05 — forked from varunagrawal/on-exit-sync.py
Script to sync Taskwarrior after each operation
#!/usr/bin/env python3
# This hooks script syncs task warrior to the configured task server.
# The on-exit event is triggered once, after all processing is complete.
# Make sure hooks are enabled and this hook script is executable.
# Run `task diag` for diagnostics on the hook.
import sys
import json