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
"""The cURL command line tool allows you to specify multiple URLs in a | |
single string. For example: | |
http://site.{one,two,three}.com | |
ftp://ftp.numericals.com/file[1-100].txt | |
ftp://ftp.numericals.com/file[001-100].txt (with leading zeros) | |
ftp://ftp.letters.com/file[a-z].txt | |
This module can take a string in this format, and return the list of strings | |
that it specifies. The exact syntax can be seen in the examples on the cURL man |
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/python | |
"""A script for managing a dictionary of acronyms. For context, see the | |
associated blog post: http://alexwlchan.net/2014/12/acronyms/ | |
Invoke with the -h or --help flag for a usage message: | |
$ ./acronyms.py -h | |
Invoke with the -a or --add flag to add an acronym: |
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
on open some_images | |
repeat with my_image in some_images | |
try | |
rescale_and_copy(my_image) | |
end try | |
end repeat | |
end open | |
to rescale_and_copy(my_item) | |
tell application "Image Events" |
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
tell application "iTerm" | |
activate | |
-- Change this if you want to find a different process | |
set myprocess to "irssi" | |
set procrunning to false | |
-- Count the number of terminal windows open | |
set mytermcount to count of terminal |
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/python | |
import sys | |
import os, shutil | |
import subprocess | |
import os.path | |
from datetime import datetime | |
######################## Functions ######################### |
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 python | |
""" | |
A quick script for tidying up data from the HealthKit export file. | |
To get an export file: | |
1) Open the Health app on iOS | |
2) Under "Health Data", select "All" | |
3) Use the share button to get a copy of your data in XML format | |
This script allows you to get data for one particular value, and turn it into |
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 -*- | |
""" | |
A script for quickly injecting records into DynamoDB. | |
Useful for testing apps that hang off a DynamoDB event stream. | |
""" | |
import itertools | |
import sys |
OlderNewer