Skip to content

Instantly share code, notes, and snippets.

@hufman
hufman / puzzles.py
Last active April 27, 2018 20:20
Python puzzles
1
2 3
4 5 6
7 8 9 10
http://rextester.com/OUC7480
import itertools
r = itertools.chain(range(1,11)); print('\n'.join([' '.join([str(n) for n in itertools.islice(r, l)]) for l in range(1,5)]))
http://rextester.com/DPXLL55930
r = range(1,11); print('\n'.join([' '.join([str(r.pop(0)) for i in range(0, l)]) for l in range(1,5)]))
@hufman
hufman / Animal Crossing Infobox Parser
Last active January 2, 2016 22:37
Animal Crossing Wikia Parser
You'll need to `pip install mwparserfromhell` to run this code. Tested in Python 2.7 and 3.2.
@hufman
hufman / docker-compile.pl
Last active September 2, 2015 06:18 — forked from mpasternacki/docker-compile.pl
Perl script to build a Docker image from Dockerfile that creates the image in a single layer, without any intermediate images. Needs JSON CPAN module (available as `libjson-perl` Debian/Ubuntu package). Usage: run the script in the directory that contains a Dockerfile.More details in a blog post: http://3ofcoins.net/2013/09/22/flat-docker-images/If
#!/usr/bin/env perl
use feature 'switch';
use strict;
use warnings;
no if $] >= 5.018, warnings => "experimental::smartmatch";
use Data::Dumper;
use File::Basename;
use File::Copy;
@hufman
hufman / docker-compile.pl
Last active August 29, 2015 13:58
Dockerfile compile to a flat image
#!/usr/bin/env perl
# Modified from http://3ofcoins.net/2013/09/22/flat-docker-images/
use feature 'switch';
use strict;
use warnings;
use Data::Dumper;
use File::Basename;
use File::Copy;

Keybase proof

I hereby claim:

  • I am hufman on github.
  • I am hufman (https://keybase.io/hufman) on keybase.
  • I have a public key whose fingerprint is 75D9 FDC6 3E86 8A67 ECCA D5A5 CFD7 A940 28D8 4BDB

To claim this, I am signing this object: