I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
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 |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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 |