Skip to content

Instantly share code, notes, and snippets.

View jzempel's full-sized avatar

Jonathan Zempel jzempel

  • Zendesk
  • California
View GitHub Profile
@jzempel
jzempel / IllustratorSaveAsSVGs.jsx
Last active March 28, 2018 22:08 — forked from seltzered/IllustratorSaveAsSVGs.jsx
Quick little script to batch-convert Illustrator .ai's to .svg's, based on Adobe's sample 'save to pdf's' script. Save it to a jsx, and load it under illustrator. Intended for Illustrator CS6.
/**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2010 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
@jzempel
jzempel / pkgtag.py
Created January 29, 2016 01:05
Custom git command for tagging in sync with package versions.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pkgtag
~~~~~~
Execute git-tag based on package versions.
"""

Keybase proof

I hereby claim:

  • I am jzempel on github.
  • I am jzempel (https://keybase.io/jzempel) on keybase.
  • I have a public key whose fingerprint is 773B E655 5D32 E24D BE49 5459 8FB6 C9F2 073A 4531

To claim this, I am signing this object:

@jzempel
jzempel / pipdiff.py
Last active December 11, 2015 15:59
View a summary list of package release differences between your local environment and PyPI.
#!/usr/bin/env python
try:
from pip import get_installed_distributions
except ImportError:
from sys import exit
exit("pip not available")
from pkg_resources import parse_version
@jzempel
jzempel / skeleton.html
Created December 5, 2012 22:01
skeleton
<!DOCTYPE html>
<html lang="en">
<head prefix="fb: http://ogp.me/ns/fb# og: http://ogp.me/ns#">
<meta charset="utf-8" />
<title>[localhost]</title>
<meta property="og:url" content="https://gist.github.com/4219899" />
<meta property="og:site_name" content="[localhost]" />
@jzempel
jzempel / utils.py
Created September 8, 2012 22:06
Constant Duplicates
import re
def duplicates(module):
"""Determine if the given module contains multiple definitions for the
same constant.
:param module: The module to check.
"""
ret_val = set()
@jzempel
jzempel / utils.py
Created September 8, 2012 22:02
Constant Diff
def diff(module1, module2):
"""Determine the difference in constant definitions between two modules.
:param module1: First module with constants.
:param module2: Second module with constants.
"""
_and = {}
_or = {}
_xor = {module1: {}, module2: {}}
@jzempel
jzempel / application:__init__.py
Created July 29, 2012 21:19
Flask with Celery (wish list)
from blueprint import example
from extensions import celery, mail
from flask import Flask
import settings
def create_app(settings=settings):
ret_val = Flask(__name__)
ret_val.config.from_object(settings)
# initialize extensions...
@jzempel
jzempel / application:__init__.py
Created July 29, 2012 20:37
Flask with Celery 3.0
from blueprint import example
from extensions import mail
from flask import Flask
import settings
def create_app(settings=settings):
ret_val = Flask(__name__)
ret_val.config.from_object(settings)
# initialize extensions...
@jzempel
jzempel / survivor.py
Created July 22, 2012 19:40
Duck, Duck, Survivor
def survivor(count):
if count >= 2:
survivors = range(1, count + 1)
start = 1
last = survivors[-1]
while len(survivors) > 1:
survivors = survivors[start::2]
start = 1 if last == survivors[-1] else 0
last = survivors[-1]