Skip to content

Instantly share code, notes, and snippets.

@roderickm
roderickm / gist:5832922
Created June 21, 2013 17:40
Timeline of Robert Picard's interview of Armin Ronacher for the Practical Flask Book
http://www.youtube.com/watch?v=fs20qdvm0K4
http://www.kickstarter.com/projects/1223051718/practical-flask-book-project/posts
00:00 Geeks have an awkward moment
00:40 What did you do before Flask?
01:35 What was the impetus for Flask/Jinja/Werkzeug?
03:10 Released 0.10; should we use Python3 now? Maybe not just yet…
06:12 How are Blueprints supposed to be used?
09:10 Best practices for configuration
12:58 Adv pattern example: custom exception handler
  1. Plain Strings (207): foo
  2. Anchors (208): k$
  3. Ranges (202): [a-f]{4}
  4. Backrefs (201): (...).*\1
  5. Abba (193): ^(?!.*(.)(.)\2\1)
  6. A man, a plan (176): ^(.)(.).*\2\1$
  7. Prime (286): ^(?!(..+)\1+$)
  8. Four (199): (.)(.\1){3}
  9. Order (198): ^[^o].....?$
  10. Triples (589): ^[378][12479]|00($|[369]|1[25])|55|2[347]
@roderickm
roderickm / keybase.md
Last active June 4, 2018 16:51
Keybase Proof

Keybase proof

I hereby claim:

  • I am roderickm on github.
  • I am roderickm (https://keybase.io/roderickm) on keybase.
  • I have a public key ASA-v3Y_Otm_22jDZIQdvNO4xw64DVdkP2qR2fgTApwFVQo

To claim this, I am signing this object:

import os
import gearman
from PIL import Image
MINI_SIZE = (50, 50)
THUMB_SIZE = (150, 150)
MOBILE_SIZE = (600, 600)
FULL_SIZE = (1024, 1024)
@roderickm
roderickm / .tmux.conf
Last active August 29, 2015 14:08 — forked from dbeckham/.tmux.conf
#
# Custom tmux commands for remote servers
#
# Copy this to ~/.tmux.conf to enable
#
# Make splitting and resizing panes, and moving around emulate the vim
# directional keys
bind | split-window -h
bind _ split-window -v
#!/bin/bash
#####
# Builds a custom nginx
#
# RELEASE_TAGS="+your+tags+here"
# RELEASE_MAINTAINER="Your Name Here"
# RELEASE_MAINTAINER_EMAIL="hi@example.com"
# RELEASE_MESSAGE="Some message"
#
@roderickm
roderickm / trac2down.py
Last active August 29, 2015 14:25 — forked from sgk/trac2down.py
Trac Wiki to Markdown converter
#!/usr/bin/python
# vim:set fileencoding=utf-8 sw=2 ai:
import sqlite3
import datetime
import re
SQL = '''
select
name, version, time, author, text
@roderickm
roderickm / puppet-tips.md
Created January 13, 2016 16:57
Puppet tips, tricks, and one-liners

Use 'apply' to eval puppet vars

puppet apply -e 'notify { "$::osfamily/$::operatingsystem": }'
Notice: Compiled catalog for bdb33588915b.localdomain in environment production in 0.01 seconds
Notice: Debian/Ubuntu
Notice: /Stage[main]/Main/Notify[Debian/Ubuntu]/message: defined 'message' as 'Debian/Ubuntu'
Notice: Finished catalog run in 0.01 seconds

Go from empty VM to running app with a couple commands

@roderickm
roderickm / join.py
Created April 14, 2017 16:44
Combine PDFs into a single file, allowing a single page to be picked from the input files.
#! /usr/bin/python
#
# join
# Joining pages from a collection of PDF files into a single PDF file.
#
# join [--pickpage <pagenum>] [--output <file>] [--shuffle] [--verbose]"
#
# Parameter:
#
# --pickpage <pagenum>