Skip to content

Instantly share code, notes, and snippets.

View extratone's full-sized avatar
🗿
sudo exit

David Blue extratone

🗿
sudo exit
View GitHub Profile
@omz
omz / Pythonista Theme Editor.py
Last active August 8, 2023 14:42
Pythonista Theme Editor.py
# coding: utf-8
'''
Basic theme editor for Pythonista 1.6 (beta)
WARNING: Use at your own risk! User themes aren't "officially" supported, and
this may break in future versions. If you enter invalid JSON or anything else
that the app can't deal with, it *will* crash -- your input is not validated
in any way.
'''
@bmispelon
bmispelon / patreon_downloader.py
Last active March 30, 2021 06:30
Download monthly patron reports from Patreon (CSV).
"""
Download your monthly patron reports from Patreon (CSV).
Requires requests and lxml.
"""
import argparse
from datetime import datetime
from getpass import getpass
import logging
from os import makedirs, path
@omz
omz / SetTheme.py
Created July 29, 2015 12:28
SetTheme.py
# Utility functions for setting UI/syntax highlighting theme in Pythonista (1.6 beta) using objc_util. WARNING: This relies on some internals that may change in the future.
# When run as a script, it toggles between the default (light) theme and Tomorrow-Dark.
from objc_util import *
import os
import glob
def get_theme_names():
res_path = str(ObjCClass('NSBundle').mainBundle().resourcePath())
theme_paths = glob.glob(os.path.join(res_path, 'Themes2/*.json'))
@omz
omz / CodeEditor Demo.py
Created July 28, 2015 22:18
CodeEditor Demo.py
# coding: utf-8
'''
NOTE: This requires the latest beta of Pythonista 1.6 (build 160022)
Demo of using Pythonista's own internals to implement an editor view with syntax highlighting (basically the exact same view Pythonista uses itself)
IMPORTANT: This is just for fun -- I was curious if it would work at all, but I don't recommend that you rely on this for anything important. The way Pythonista's internals work can change at any time, and this code is *very* likely to break in the future.
'''
import ui
@reberhardt7
reberhardt7 / export_issues.py
Created July 17, 2015 20:05
Github Issues Export: This script exports all issues from a repository, along with comments and events, into a JSON file. It also produces a Markdown file that can be used to easily view the issues.
"""
This script uses Github's API V3 with Basic Authentication to export issues from
a repository. The script saves a json file with all of the information from the
API for issues, comments, and events (on the issues), downloads all of the
images attached to issues, and generates a markdown file that can be rendered
into a basic HTML page crudely mimicking Github's issue page. If the gfm module
is available, the script will go ahead and render it itself.
In the end, you'll be left with a folder containing a raw .json file (which you
can use to extract information for your needs, or to import it somewhere else),
@kshiteesh
kshiteesh / urlsafari
Last active January 16, 2025 02:37
This AppleScript saves all the tabs open in all Safari windows to a Markdown file.
(*
Export All Safari Tabs in All Open Windows to a Markdown File
July 13, 2015
// SCRIPT PAGE
http://hegde.me/urlsafari
// ORIGINAL SCRIPT ON WHICH THIS SCRIPT IS BUILT
http://veritrope.com/code/export-all-safari-tabs-to-a-text-file
@jsomers
jsomers / a-wotd-custom-word-list.md
Last active September 20, 2024 09:17
How to use a custom word list with OS X's "Word of the Day" screensaver

OS X's "Word of the Day" screensaver is a great way to passively learn words:

But I've always thought that its word list kind of stunk—it was full of obscure words that I could never really see myself using. I'd prefer something like Norman Schur's 1000 Most Important Words. What if you could plug your own word list into the screensaver?

On a rather obscure comment thread, someone explained where you might find the word list that Apple uses to power the screensaver. It is at /System/Library/Graphics/Quartz\ Composer\ Plug-Ins/WOTD.plugin/Contents/Resources/NOAD_wotd_list.txt. The file looks like this:

m_en_us1282510	quinsy
@kgn
kgn / AppReviews
Created June 9, 2015 23:02
App Reviews - Python script to retrieve App Store reviews and save them to a CSV file
#!/usr/bin/env python
try:
# For Python 3.0 and later
from urllib.request import urlopen
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
import json
@ianthomas
ianthomas / exporter.py
Last active November 9, 2020 05:34
save tweets to text file, improved
__author__ = 'apreston'
from pymongo import MongoClient
import datetime, time, string
import codecs
import itertools
#c = MongoClient()
c = MongoClient("mongodb://datascientist:pass@host/db")
db = c.mj_tweets
collection = db.mj_sample