Skip to content

Instantly share code, notes, and snippets.

View treejamie's full-sized avatar
🌳
working with trees

Tree Jamie treejamie

🌳
working with trees
View GitHub Profile
<article>
<section class="stats">
<h1>Why Mobile?</h1>
<img src="" alt="Reasons to go mobile" />
<ul>
<li>
<strong>1.4</strong>
Mobile Devices per person
@treejamie
treejamie / backup.py
Created October 24, 2012 12:00
upgraded to encrypt and designed to be ran as hourly daily weekly or monthly
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import optparse
import subprocess as sp
import gzip
from datetime import datetime
try:
from boto.s3.connection import S3Connection, Location
@treejamie
treejamie / Contract Killer 3.md
Created November 9, 2012 14:15
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@treejamie
treejamie / Contract Killer 3.md
Created November 15, 2012 17:26
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@treejamie
treejamie / emoji_sad.txt
Created November 27, 2012 05:14 — forked from mranney/emoji_sad.txt
Why we can't process Emoji anymore
From: Chris DeSalvo <[email protected]>
Subject: Why we can't process Emoji anymore
Date: Thu, 12 Jan 2012 18:49:20 -0800
Message-Id: <[email protected]>
--Apple-Mail=_6DEAA046-886A-4A03-8508-6FD077D18F8B
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
@treejamie
treejamie / gist:5636287
Created May 23, 2013 14:01
In an exercise of experimentation I'm seeing if I can get a uuid4 collision in less than 20,000,000.
import sys
import uuid
ids = set()
try:
while True:
id = uuid.uuid4()
if id in ids:
break
@treejamie
treejamie / mytags.py
Created June 14, 2013 09:18
navigation example for a templatetag
from django.template import Node, Library, Variable
from myapp.models import Whatever
register = Library()
class NavigationNode(Node):
def __init__(self, user, varname):
# this is a variable in the template so we need to resolve later
Thursday, September 5, 2013
On the NSA
Let me tell you the story of my tiny brush with the biggest crypto story of the year.
A few weeks ago I received a call from a reporter at ProPublica, asking me background questions about encryption. Right off the bat I knew this was going to be an odd conversation, since this gentleman seemed convinced that the NSA had vast capabilities to defeat encryption. And not in a 'hey, d'ya think the NSA has vast capabilities to defeat encryption?' kind of way. No, he'd already established the defeating. We were just haggling over the details.
Oddness aside it was a fun (if brief) set of conversations, mostly involving hypotheticals. If the NSA could do this, how might they do it? What would the impact be? I admit that at this point one of my biggest concerns was to avoid coming off like a crank. After all, if I got quoted sounding too much like an NSA conspiracy nut, my colleagues would laugh at me. Then I might not get invited to the cool security parties.
All of this is a
@treejamie
treejamie / nginx.conf
Created November 10, 2013 12:20
Nginx SSL config for proxying to jenkins
upstream jenkins {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
server_name {{ jenkins_url }};
rewrite ^ https://$server_name$request_uri? permanent;
}
@treejamie
treejamie / gist:52ec4980a713743bfa78
Last active September 21, 2015 11:02 — forked from riywo/gist:5000181
How to delete git remote(origin) branch or tag?
# branch
$ git branch -d BRANCH # delete local BRANCH
$ git push origin :BRANCH # delete remote BRANCH
# tag
$ git tag -d TAG # delete local TAG
$ git push origin :refs/tags/TAG # delete remote TAG