Skip to content

Instantly share code, notes, and snippets.

@allanburleson
allanburleson / sanderson-progress.py
Last active May 2, 2023 19:27
Checks Brandon Sanderson’s website for book progress bar updates and tweets them.
import json
import os
from bs4 import BeautifulSoup
import requests
import twitter
TWITTER_CLIENT = twitter.Twitter(
auth=twitter.OAuth('REDACTED',
@allanburleson
allanburleson / basic.zsh-theme
Created August 21, 2016 21:24
My simple zsh theme (for use with oh-my-zsh)
PROMPT='%n@%m : %{$fg[green]%}%~%{$fg_bold[blue]%}$(git_prompt_info)%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=")"
ZSH_THEME_GIT_PROMPT_DIRTY=" $fg[red]:($fg[blue]"
ZSH_THEME_GIT_PROMPT_CLEAN=" $fg[green]:)$fg[blue]"
@allanburleson
allanburleson / hiddenfiles.py
Created July 26, 2016 23:00
Show/hide hidden files on macOS
#!/usr/bin/python
import subprocess
import sys
def help():
print('hiddenfiles show|hide')
if len(sys.argv) == 2:
@allanburleson
allanburleson / Add Playground Page.py
Created July 3, 2016 18:59 — forked from omz/Add Playground Page.py
Add Playground Page.py
#! python3
# Share sheet extension script for adding new pages to Swift Playgrounds (experimental)
# HOW TO USE:
# 1. Add this script as a shortcut to the Pythonista extension (either from Pythonista's settings or the share sheet extension itself)
# 2. Tap the "Share" button in the Playground app's library.
# 3. Select the playground that you want to add a page to
# 4. Select "Run Pythonista Script" in the share sheet
# 5. Run this script, to select the chapter and page title.
@allanburleson
allanburleson / ScrabbleDict.py
Last active January 25, 2016 18:09
ScrabbleDict.py
# coding: utf-8
from bs4 import BeautifulSoup
import requests
import sys
import webbrowser
pythonista = True
try:
import notification
import console
except ImportError:
@allanburleson
allanburleson / urlshorten.py
Last active January 14, 2016 15:02
urlshorten.py
# coding: utf-8
# For Pythonista iOS app
# Bookmarklet:
# javascript:window.location.href='pythonista://urlshorten?action=run&argv='+encodeURIComponent(window.location.href);
import appex
import bitly_api
import clipboard
import sys