Skip to content

Instantly share code, notes, and snippets.

@error9900
error9900 / run_and_show_function_example.sh
Created April 14, 2025 20:20
Example of using a function inside a /bin/sh script to display a command followed by the output of the command
#!/bin/sh
run_and_show() {
echo "Running: $*"
"$@"
}
run_and_show df -h
@error9900
error9900 / splunk_dashboard_refresh_button.xml
Created March 27, 2025 18:11
Add a Refresh button to a Splunk dashboard
<!-- Add this <html> element inside of the <fieldset> element -->
<html>
<style>
div.fieldset.dashboard-form-globalfieldset
div.dashboard-element.html.dashboard-element-html {
display: inline-block;
}
a {
margin-right: 10px;
@error9900
error9900 / miscellaneous_bookmarklets.js
Last active March 27, 2025 17:22
Miscellaneous bits of JavaScript potentially useful for bookmarklets
// https://en.wikipedia.org/wiki/Bookmarklet
// https://en.wikipedia.org/wiki/URL#Syntax
// https://developer.mozilla.org/en-US/docs/Web/API/Location
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator
// https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard
// Clean URL
created after: -180 days
no date
!no date
today
due after: today
!(due after: today)
!(date after: today)
!(date before: today)
!(date before: -1 min)
@error9900
error9900 / swap_todoist_labels.py
Last active January 31, 2024 00:46
Change one Label to another Label on all tasks with the first Label...
"""
This will find all Tasks with a specific Label, remove that Label, and add another specified Label.
Make sure you add your API token to `data/token.txt`!
You'll need the Python SDK for this to work:
https://developer.todoist.com/rest/v2/#python-sdk
"""
import uuid
@error9900
error9900 / sort_todoist_labels.py
Created January 30, 2024 23:32
Sort Todoist Labels alphabetically
"""
Make sure you add your API token to `data/token.txt`!
"""
import sys
import uuid
import requests
@error9900
error9900 / get_completed_items.py
Created November 10, 2023 06:42
Get completed items from Todoist
"""
Put your token in data/token.txt.
Completed items are written to `output/completed_items.py` as a Python dictionary.
Reference: https://developer.todoist.com/sync/v9/#get-all-completed-items
"""
import requests