Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
nolanlawson / backup_twitter_media.py
Created December 4, 2017 00:36
Script to backup media (images) in a Twitter archive
#!/usr/bin/env python
# Given a Twitter archive, replace all references to Twitter hosted images with a downloaded local image.
# Usage: place in the directory of the Twitter export (at the same level as the index.html file) and run it.
# Note: doesn't work for video. Skips images that fail to download.
import errno
import os
import re
import requests
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@FrozenCow
FrozenCow / mydebianimages.json
Created October 11, 2013 17:46
Example of repository file for DriveDroid 0.9.0
[
{
"id": "mydebian",
"name": "My Debian Images",
"url": "http://www.debian.org/",
"releases": [
{
"version": "6.0.6",
"arch": "amd64",
"size": 176160768,