Skip to content

Instantly share code, notes, and snippets.

@adamsmith
adamsmith / gist:2a22b08d3d4a11fb9fe06531aea4d67c
Created December 23, 2023 01:07
voice-memo transcript → organized markdown text, using LLMs
There are two prompts, that chain together. The first prompt does most of the work, and the second prompt organizes the sections. I found because of the nature of how LLMs write, I couldn't get just one prompt to never jump back and forth in topics.
Prompt 1, which takes as input a raw transcript and generates a structured-text version...
"""# Instructions
A transcript is provided below of a voice memo I recorded as a "note to self". please extract all the points made or thoughts described, and put them in bullet-point form. use nested bullet points to indicate structure, e.g. a top-level bullet for each topic area and sub-bullets underneath. use multi-level nesting as appropriate to organize the thinking logically. use markdown formatting with `*` instead of `-` for bullet points.
DO NOT OMIT ANY POINTS MADE. This is not a summarization task — your only goal is to structure the thoughts there so they are logically organized and easy to read. Be concise because the reader is busy, but again DO NOT omit any
@adamsmith
adamsmith / apple_voice_memo_handler.py
Last active March 22, 2024 22:16
Automated Apple Notes transcription to Markdown file
import os
import datetime
import json
import pathlib
import secrets
import sqlite3
import subprocess
import time
# Description: This code continuously polls for new Apple Voice Memos. When a new one is found, it is transcribed using
@jmbwell
jmbwell / dreamhost_dns.py
Last active June 14, 2023 07:36
A quick Ansible module for updating DreamHost DNS records.
#!/usr/bin/python
# Copyright: (c) 2022, John Burwell <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
---
@tannercollin
tannercollin / sn004-demo.py
Last active November 1, 2021 15:58
Standard Notes protocol v004 reference decryption demo
# Standard Notes protocol v004 reference decryption demo
# by Tanner Collin, MIT license
#
# Install dependencies in your Python 3 environment:
# pip install argon2-cffi requests pycryptodome
#
# do not use your real account
# use a fresh account so there's no 003 items
# or use this test account
email = '[email protected]'
@SimonSapin
SimonSapin / pdfedit.py
Created December 21, 2020 10:51
Make a PDF file editable in LibreOffice, using Poppler and Inkscape
#!/usr/bin/env python3
"""
Make a PDF file editable in LibreOffice.
LibreOffice Draw can import and export PDF files, effectively making it a PDF editor.
However text in imported documents often looks broken, such as with
text rendered with a different font and overflowing into the next column.
What I suspect happens is that PDF files typically embed every font they use,
but LibreOffice’s internal document model does not support embedded fonts
@mathematicalmichael
mathematicalmichael / remove_output.py
Last active September 15, 2022 22:56 — forked from damianavila/remove_output.py
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb
Modified from remove_output by Minrk
Modified from remove_output by mathematicalmichael
"""
import sys
import io
import os
from nbformat import read, write, NO_CONVERT
@caramelchocolate
caramelchocolate / gist:1cf0c660d99482cf9f0f8b3aad6506fe
Last active January 16, 2021 17:55
Get local directory of Evernote notes from SQLite.
# SQLite path in Mac.
/Users/***/Library/Containers/com.evernote.Evernote/Data/Library/Application\ Support/com.evernote.Evernote/accounts/www.evernote.com/***/localNoteStore/LocalNoteStore.sqlite
# SQL
SELECT ZLOCALUUID FROM ZENNOTE WHERE ZGUID="foo";
@danrouse
danrouse / gmail-compose-encoder.js
Created May 3, 2018 16:22
gmail `compose` query parameter encoder/decoder
const fullAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const restrictedAlphabet = 'BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz';
const threadPrefix = 'thread-';
const messagePrefix = 'msg-';
const isWhitespace = str => /^[\s\xa0]*$/.test(str);
const isInvalidString = str => str ? (str.indexOf(threadPrefix) !== -1 || str.indexOf(messagePrefix) !== -1) : false;
const encode = function(str) {
if (isWhitespace(str)) return str;
@tryone144
tryone144 / enct2.py
Created January 29, 2018 20:40
Implementation of the AES protocol as used by https://encipher.it
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# implementation of the AES protocol as used by https://encipher.it
#
# (c) 2018 Bernd Busse
from cryptography.hazmat.primitives.ciphers import Cipher
from cryptography.hazmat.primitives.ciphers.algorithms import AES
from cryptography.hazmat.primitives.ciphers.modes import ECB, CTR
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 16, 2024 17:13 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.