Skip to content

Instantly share code, notes, and snippets.

View machawk1's full-sized avatar

Mat Kelly machawk1

View GitHub Profile
@Zearin
Zearin / python_decorator_guide.md
Last active April 28, 2026 03:05
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@Asparagirl
Asparagirl / gist:6206247
Last active July 12, 2025 08:42
Have a WARC that you would like to upload to the Internet Archive so that it can eventually be included in their Wayback Machine? Here's how to upload it from the command line.

Do you have a WARC file of a website all downloaded and ready to be added to the Internet Archive? Great! You can do that with the Internet Archive's web-based uploader, but it's not ideal and it can't handle really big uploads. Here's how you can upload your WARC files to the IA from the command line, and without worrying about a size restriction.

First, you need to get your Access Key and Secret Key from the Internet Archive for the S3-like API. Here's where you can get that for your IA account: http://archive.org/account/s3.php Don't share those with other people!

Here's their documentation file about how to use it, if you need some extra help: http://archive.org/help/abouts3.txt

Next, you should copy the following files to a text file and edit them as needed:

export IA_S3_ACCESS_KEY="YOUR-ACCESS-KEY-FROM-THE-IA-GOES-HERE"
@willurd
willurd / web-servers.md
Last active July 27, 2026 15:02
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@edsu
edsu / wget-warc.txt
Created December 2, 2011 10:34
example of using wget's warc functionality
.-(ed@curry 05:24:32) ~
`-->wget --recursive --warc-file=c4lj.warc.gz http://journal.code4lib.org
FINISHED --2011-12-02 05:17:11--
Total wall clock time: 19m 24s
Downloaded: 1524 files, 99M in 4m 17s (395 KB/s)
.-(ed@curry 05:45:22) ~
`-->ls -lh c4lj.warc.gz.warc.gz
-rw-rw-r-- 1 ed ed 85M 2011-12-02 05:17 c4lj.warc.gz.warc.gz