Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env zsh
# frame foo.webp bar.png
rm -rf framed
mkdir framed
for img in ${@:1}; do
magick "$img" \
-fuzz 1% -trim -bordercolor white -border 100 \
-resize "1024x576" \
-background "#EEE" -compose Copy -gravity center -extent "1600x900" \
"framed/$img"
@chadwhitacre
chadwhitacre / gist:3651197
Created September 6, 2012 04:21
Arranging 100 Symbols

Last night I had my first experience teaching programming to beginners. The students had read the first three sections of the HTML 4 specification, and during the class session we installed a text editor and web browser, and started building web pages from scratch.

Based on the questions they asked and the discussion we had, I decided that it might help to zoom out a level and frame the concept of “programming” in general terms. This is what I came up with.


Computers are a tool to extend our power of reason.

Reason can be thought of as a processing of symbols according to rules.

@chadwhitacre
chadwhitacre / sq
Last active February 24, 2021 21:24
sq - squash git commits easily
#!/usr/bin/env zsh
#
# https://gist.github.com/chadwhitacre/5d2ff5f46cd0bc981b3f3b76cf891b97
#
# Squash the N most recent git commits together (default: 2), using the oldest
# one's commit message.
N=${1:-2}
msg="$(git log --format=%B -n 1 HEAD~$(( $N - 1 )))"
git reset --soft HEAD~$N && git commit -nm "$msg"
@chadwhitacre
chadwhitacre / gist:3625032
Created September 4, 2012 18:59
Testing Public Gists

Testing public gists.

@chadwhitacre
chadwhitacre / charts.json
Created May 11, 2018 16:10
Gittip/Gratipay History
[
{
"date": "2017-12-28",
"nteams": "95",
"nusers": "295",
"volume": "476.44",
"xTitle": "2017-12-28"
},
{
"date": "2017-12-21",
@chadwhitacre
chadwhitacre / gist:3620922
Created September 4, 2012 12:55
We Need an Open *Economist*

A friend of mine recently started publishing on Svbtle, a super-classy, invite-only blogging platform. I like the super-classy part, not so much the invite-only part. Can we have classy and open?

The Promise of Svbtle

The only way I get to see Svbtle's editing interface is when its creator, Dustin Curtis, deigns to show me. Turns out I love it. It feels like Apple to me. And like Apple, Svbtle whiffs of totalitarianism. Are these two traits, high quality and crushing control, inseparable? From Dustin:

I’ve decided to open [Svbtle] up to a small number of vetted bloggers. At least at first. The goal is simple: when you see the Svbtle design, you should know that the content is guaranteed to be great.

When I see the Svbtle design, I think, "Gee, I wish I were part of this elite club." If it were really about the content, Svbtle would be more like The Economist. It would [downplay the identity](http://www.quora.com/The-Economist/Will-The-Econ

# Given this List of Songs, Construct Arrays by Artist and Album
# Hint: Make use of the split() String Method
# http://www.ruby-doc.org/core-1.9.3/String.html#method-i-split
# Simple Example of Data Parsing
songs = [
"The Magnetic Fields - 69 Love Songs - Parades Go By",
"The Magnetic Fields - Get Lost - Smoke and Mirrors",
"Neutral Milk Hotel - In An Aeroplane Over the Sea - Holland 1945",
"The Magnetic Fields - Get Lost - You, Me, and the Moon",
@chadwhitacre
chadwhitacre / gittip-yc-application.md
Last active December 24, 2015 01:19
Gittip's YC Application (W14).
PERSONAL_API_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxx
REPO=www.gittip.com
HEAD=issue-1426
ISSUE=1426
curl https://api.github.com/repos/gittip/$REPO/pulls \
-u $PERSONAL_API_TOKEN: \
-X POST \
-d"{\"issue\": \"$ISSUE\", \"head\": \"$HEAD\", \"base\": \"master\"}"
# This adds tab completion of git branch names (including remotes) to several
# git-related bash aliases I have set up:
#
# co git checkout
# gb git branch
# gm git merge
#
#
# Bugs:
#