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
// ==UserScript== | |
// @name SFF.SE Show spoilers on questions with particular tags | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Show all spoilers on SFF.SE questions with specified tags | |
// @author alexwlchan | |
// @match *://scifi.stackexchange.com/questions/* | |
// @match *://meta.scifi.stackexchange.com/questions/* | |
// @grant none | |
// ==/UserScript== |
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 | |
""" | |
This script can be used to get a per-author RSS feed on iMore.com. It will try to | |
cache the entries, so the last 40 entries from an author will show up, even if | |
they're no longer in the main feed. | |
To invoke, just call this script at the command line: | |
python settern_rss.py | |
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 python3 | |
# -*- encoding: utf-8 -*- | |
""" | |
download_files.py | |
~~~~~~~~~~~~~~~~~ | |
This is a file downloader for Python with a few special features: | |
* If the user doesn't supply a filename, try to infer a filename and | |
file extension from the URL. |
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 | |
# -*- encoding: utf-8 -*- | |
""" | |
Utility functions for dealing with URL query strings in Python, | |
i.e., URLs of the form | |
http://example.net?field1=value1&field2=value2 | |
This module includes a pair of helper functions: one for getting the values | |
associated with a particular field; another for setting the query string |
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 | |
# -*- encoding: utf-8 -*- | |
""" | |
A script for quickly injecting records into DynamoDB. | |
Useful for testing apps that hang off a DynamoDB event stream. | |
""" | |
import itertools | |
import sys |
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 | |
# -*- encoding: utf-8 -*- | |
"""Guess a filename from a URL. | |
Suppose you want to download a file from a URL, and you want to preserve | |
the name of the original file as closely as possible. This snippet | |
provides a function for doing so. | |
""" |
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 | |
# -*- encoding: utf-8 -*- | |
"""Generate unique filenames for a file you're about to create. | |
The functions in this snippet are useful for ensuring you don't inadvertently | |
create a file that replaces an existing file. Given a name, they try to | |
find a similar name that doesn't already exist on the disk. | |
This code isn't safe from race conditions -- if a file pops into existence | |
between the check and the write, you could still lose data -- but it's a |
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 | |
# -*- encoding: utf-8 -*- | |
"""Returns a human-friendly word count of the string passed to stdin. | |
Example outputs: | |
* 5 words | |
* 100 words | |
* 1.5k words | |
* 10k words |
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
// auto_collapse_deferred_items.js | |
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
// | |
// This script collapses any projects with the @defer tag in the frontmost | |
// window. Useful for tidying up the window, so I don't have to see the | |
// detail associated with those projects. | |
'use strict' | |
function TaskPaperCollapseDeferredItems(editor, options) { |
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 | |
# -*- encoding: utf-8 -*- | |
"""I have a TaskPaper file I keep in Dropbox that contains some tasks for my | |
daily routine. | |
This script runs once a day and resets every item on that list, removing | |
the @done tag and replacing the file. | |
""" |