Skip to content

Instantly share code, notes, and snippets.

Avatar

William Pietri wpietri

View GitHub Profile
View Lasagna.md

lasagna, meaty

The sauce

  • 4 tablespoons olive oil
  • 3 small onions, minced
  • lots of garlic
  • 3 carrots, peeled and minced
  • 3/4 cup minced bacon or pancetta
View IssueDemo.java
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;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@wpietri
wpietri / bits-string.py
Created Jan 19, 2016
bitstring peformance: strings beat ints
View bits-string.py
# 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
wpietri / rover.py
Created Dec 7, 2015
Rover kata example for hiring
View rover.py
class Rover:
pass
View keybase.md

Keybase proof

I hereby claim:

  • I am wpietri on github.
  • I am williampietri (https://keybase.io/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>
<html>
<head>
<title>MobileDo</title>
<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>
<script>enyo.depends(
// include support libraries
@wpietri
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 "http://softlayer-dal.dl.sourceforge.net/project/twiki/TWiki%20for%20all%20Platforms/TWiki-5.1.4/TWiki-5.1.4.tgz"
checksum "bcd8544c83eb388737e334cdc2c2734e79df63fd0a64610c144addb00bc0d70d"
end
execute "extract Twiki" do
command "tar -C /var/ -xzf " + twiki_tmp
creates "/var/twiki/COPYING"
You can’t perform that action at this time.