Skip to content

Instantly share code, notes, and snippets.

William Pietri wpietri

Block or report user

Report or block wpietri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDResources;
import org.apache.pdfbox.pdmodel.font.PDFont;
import org.apache.pdfbox.pdmodel.font.PDType0Font;
import org.apache.pdfbox.pdmodel.interactive.form.PDField;
import org.apache.pdfbox.pdmodel.interactive.form.PDTextField;
wpietri /
Created Jan 19, 2016
bitstring peformance: strings beat ints
# this is the implementation using strings - it's faster
class Bits:
def __init__(self, *args):
if len(args) == 0:
self.contents = ""
elif len(args) == 1:
if isinstance(args[0], str):
self.contents = args[0]
wpietri /
Created Dec 7, 2015
Rover kata example for hiring
class Rover:

Keybase proof

I hereby claim:

  • I am wpietri on github.
  • I am williampietri ( on keybase.
  • I have a public key whose fingerprint is E266 6E75 C996 AD62 0ED2 56C2 F9E6 B6F2 0820 8BB7

To claim this, I am signing this object:

View mobiledo.html
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf8"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<script src="enyo/enyo.js"></script>
// include support libraries
wpietri / gist:6516165
Created Sep 10, 2013
chef, the wrong way
View gist:6516165
twiki_tmp = "/tmp/twiki.tar.gz"
remote_file twiki_tmp do
source ""
checksum "bcd8544c83eb388737e334cdc2c2734e79df63fd0a64610c144addb00bc0d70d"
execute "extract Twiki" do
command "tar -C /var/ -xzf " + twiki_tmp
creates "/var/twiki/COPYING"
You can’t perform that action at this time.