Earlier this year, the Destroy All Software screencasts were free to download. I grabbed a few that sounded interesting to watch.
These are notes of new things I learned.
Earlier this year, the Destroy All Software screencasts were free to download. I grabbed a few that sounded interesting to watch.
These are notes of new things I learned.
from __future__ import print_function, unicode_literals | |
import random | |
import time | |
def generate_random_guess(chars): | |
return random.choice(chars) | |
def repeated_guesses(target): |
#!/bin/sh -e | |
if [ -z "$1" ]; then | |
echo "Usage: signature_count.sh <UK_GOVERNMENT_PETITION_JSON_URL>" | |
echo "e.g. signature_count.sh https://petition.parliament.uk/petitions/131215.json" | |
fi | |
DATA=$(wget -qO - "$1") | |
echo "Signatures by country:" | |
echo "$DATA" | jq .data.attributes.signatures_by_country[].signature_count | awk '{ sc += $1 } END { print sc }' | |
echo "Signatures by constituency:" |
#!/bin/bash | |
for i in {01..02} {04..24} {26..80} {301..340} ; do | |
curl -f -O -J -L https://media.libsyn.com/media/coffeebreakfrench/cbf-$i-basic.mp3 | |
done | |
for i in {401..424} {426..440} ; do | |
curl -f -O -J -L https//media.libsyn.com/media/coffeebreakfrench/cbf-$i-main.mp3 | |
done | |
# Handle cases which don't fit the normal pattern. |
#!/bin/sh | |
# Usage: ./url-to-pid.sh <URL file> | |
cat $1 | grep -oP '(?<=episode/)\w+' | paste -d"," -s |
#!/usr/bin/env python | |
""" Extract date and 2D length data from GPX files in current directory. """ | |
from __future__ import division, print_function | |
import decimal | |
import glob | |
import gpxpy | |
def main(): |
#!/usr/bin/env python | |
# encoding: utf-8 | |
from __future__ import (unicode_literals, print_function, | |
absolute_import, division) | |
import codecs | |
import re | |
import sys | |
import lxml.html |
jq '.["title"] | select(. == "some title")' *.json |
#forked from: Julian_Todd / PDF to HTML (https://scraperwiki.com/views/pdf-to-html-preview-1/) | |
#input url goes to line | |
import sys | |
import urllib, urllib2, urlparse | |
import lxml.etree, lxml.html | |
import re, os | |
def Pageblock(page, index): | |
''' |