Skip to content

Instantly share code, notes, and snippets.

@asottile
asottile / move_itl.py
Created November 2, 2018 03:53
move itunes library
import os.path
import shutil
import urllib.parse
from xml.sax import make_parser
from xml.sax.saxutils import XMLFilterBase
from xml.sax.saxutils import XMLGenerator
DEST = 'E:/music'
@asottile
asottile / backup_slack_emoji.py
Created September 6, 2019 21:40
script to export all slack emoji
import concurrent.futures
import json
import os.path
import urllib.request
token = '...'
url = f'https://slack.com/api/emoji.list?token={token}'
resp = urllib.request.urlopen(url)
@asottile
asottile / vs_dark_asottile.json
Created March 28, 2020 02:28
babi theme - vs_dark_asottile.json (vs dark + ini header highlight)
{
"$schema": "vscode://schemas/color-theme",
"name": "Dark (Visual Studio)",
"colors": {
"editor.background": "#1E1E1E",
"editor.foreground": "#D4D4D4",
"editor.inactiveSelectionBackground": "#3A3D41",
"editorIndentGuide.background": "#404040",
"editorIndentGuide.activeBackground": "#707070",
"editor.selectionHighlightBackground": "#ADD6FF26",
@asottile
asottile / prioritize_shiny_raid.py
Last active May 14, 2020 20:06
figure out what shiny pokemon to do
"""figure out what shiny pokemon to do.
1. adjust SEEKING as needed
2. run this
"""
import collections
SEEKING = '''\
Meowth
@asottile
asottile / queueing.py
Created July 15, 2020 21:40
really bad queue simulating sqs backed by sqlite
import contextlib
import fcntl
import json
import sqlite3
import time
import uuid
from typing import Any
from typing import Generator
from typing import Optional
from typing import Tuple
@asottile
asottile / notebook-theme.json
Created March 14, 2022 18:10
notebook-theme.json
{
"name": "Notebook",
"settings": [
{
"settings": {
"background": "#BEB69D",
"foreground": "#111"
}
},
{