This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Batch rename | |
# Usage: dub image-X.jpg *.jpg | |
# | |
# - First argument is template for renaming | |
# - The "X" in the template will be replaced with zero-padded numbers | |
# (e.g., image-001.jpg, image-002.jpg, etc.) | |
# | |
# More examples: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Split two-spread image into two different images (leaving some overlap for safety) | |
# Usage: splitimage filename.jpg | |
# ---------------------------------------------------------------------------------- | |
convert $1 -crop 56x100%+0+0 +repage output/`basename $1 .jpg`a.jpg | |
convert $1 -flop -crop 60x100%+0+0 -flop +repage output/`basename $1 .jpg`b.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# --- Required variables --- | |
RSS_URI="/rss" | |
MAIL_TO="[email protected]" | |
LOG_FILE="/var/log/httpd/access_log" | |
LOG_DATE_FORMAT="%d/%b/%Y" | |
# --- Optional customization --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import codecs | |
import requests | |
import bs4 | |
# Change these | |
year = 2013 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For PlotDevice (plotdevice.io) | |
# This code is crappy. It's hastily thrown together prototype code and shouldn't | |
# be used in anything remotely resembling a production environment. | |
def draw_sparkline(x, y, data, vital_size=1.5, child_size=0.8, marriage_size=1.5): | |
reset() | |
translate(x, y) | |
death_x = data['death'] - data['birth'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For PlotDevice (plotdevice.io) | |
# This code is crappy. It's hastily thrown together prototype code and shouldn't | |
# be used in anything remotely resembling a production environment. | |
# Originally modeled after some code in the PlotDevice manual (http://plotdevice.io/tut/Geometry) | |
CIRCLE_CENTER_X = 200 | |
CIRCLE_CENTER_Y = 200 | |
INNER_CIRCLE_RADIUS = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updated_date: "Feb 2015" | |
districts: | |
- david-smith | |
- william-adams | |
- robert-taylor | |
people: | |
- "David | Smith | Elizabeth | 435-131-1414 | 1000 S 1000 E" | |
- "William | Adams | Sarah | 435-272-2923 | 920 S 700 E" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bot: Helm | |
// Ruleset: default | |
// -------------------------------------------------- | |
var Helm = function() {}; | |
Helm.prototype = new Bot(); | |
Helm.prototype.setup = function() { | |
this.timer = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule | |
size 6x9"; | |
# alternates | |
size letter; | |
size 210x297mm; | |
size a4; | |
font Arno Pro, 10/13pt; | |
margin 1"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Code for https://blogs.bencrowder.net/cg/2012/line-art-experiments/ | |
# Uses PIL (pip install pillow) | |
import random, math | |
from PIL import Image, ImageDraw | |
image_size = 4800 |
OlderNewer