Skip to content

Instantly share code, notes, and snippets.

@flippbit
flippbit / reddit_archive_saved_posts.py
Created January 25, 2023 19:05
This python script scrapes the saved posts of multiple accounts. It also generates a table of contents to use with Obsidian.
import praw
import json
from dotenv import load_dotenv
import os
load_dotenv()
user_agent='python_saved'
with open('config.json') as f:
/*
1. Open the chat in which you want to delete your messages
2. Open the developer console
3. Copy and paste the following code into the console
4. Press enter
5. Wait until all messages are deleted or the script finishes
6. If there are messages left, rerun the script either through running main() again or by refreshing and pasting the code again
*/
@flippbit
flippbit / new_delete_teams_messages.js
Last active January 25, 2024 15:06
This script deletes all your messages in the currently open chat window. It will only work with the new Teams client. If you prefer to use the older one, you can use this (https://gist.github.com/flippbit/9231597649ac570ffa9ac72fea140b48) script instead. The newer client is a lot snappier though, so the deletion should be more efficient.
/*
0. This only works with the new Teams client
1. Open the chat in which you want to delete your messages
2. Open the developer console
3. Copy and paste the following code into the console
4. Press enter
5. Wait until all messages are deleted or the script finishes
6. If there are messages left, rerun the script either through running main() again or by refreshing and pasting the code again
*/
@flippbit
flippbit / _tree
Created March 8, 2024 18:13 — forked from alexedwards/_tree
.
├── books
│   ├── handlers.go
│   └── models.go
├── config
│   └── db.go
└── main.go
@flippbit
flippbit / get_all_completed_tasks.py
Created May 24, 2024 10:55
Todoist API: Get all completed tasks. This script gets the completed tasks on every single day, aggregates them and stores them in a CSV file.
import requests
import os
import csv
from datetime import datetime, timedelta
def get_completed_tasks(date, access_token):
url = "https://api.todoist.com/sync/v9/completed/get_all"
headers = {
"Authorization": f"Bearer {access_token}"
@flippbit
flippbit / get_all_completed_tasks.py
Created May 24, 2024 10:58
Todoist API: Get all completed tasks. This script makes use of the pagination of the endpoint to aggregate all items before storing them in a CSV file.
import requests
import os
import csv
def get_completed_tasks(offset=0, access_token=None):
url = "https://api.todoist.com/sync/v9/completed/get_all"
headers = {
"Authorization": f"Bearer {access_token}"
}