Skip to content

Instantly share code, notes, and snippets.

View shawnbot's full-sized avatar
🎹

Shawn Allen shawnbot

🎹
View GitHub Profile
@shawnbot
shawnbot / xterm-256color.md
Last active March 22, 2024 16:26
Make OS X Terminal respect 256 colors in screen

1. Ensure that Terminal declares itself as "xterm-256color"

Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color.

2. Build a version of screen that supports 256 colors

This is easy with homebrew:

brew install screen
from airtable import Airtable
class AirtableMeta:
"""
The AirtableMeta class provides access to the Airtable base schema API:
https://airtable.com/developers/web/api/get-base-schema
It's totally a hack: The base schema API ("/v0/meta/bases/{baseId}/tables")
doesn't live under the Airtable class's base_url ("/v0/{baseId}"), so we
@shawnbot
shawnbot / index.md
Last active August 23, 2023 10:18
Testing web pages with Xcode's iOS Simulator

Finding the Simulator

You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":

screen shot 2013-05-06 at 12 04 27 pm

Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):

screen shot 2013-05-06 at 12 05 45 pm

@shawnbot
shawnbot / Makefile
Created August 7, 2013 01:36
Read environment variables from your .env in make tasks.
test:
source .env && echo "my secret key is: $$SECRET_KEY"
@shawnbot
shawnbot / README.md
Last active March 14, 2023 20:13
50 US states as JSON

How this was made

  1. Visit the list of U.S. state abbreviations on Wikipedia.

  2. Sort the table by "status of region" to group the states together

  3. Select the cells of all of the states (from "Alabama" to "Wyo.") and press ⌘C to copy

  4. Cut the TSV in your clipboard to two columns (name and two-letter code)

    pbpaste | cut -d$'\t' -f1,4 | pbcopy
@shawnbot
shawnbot / README.md
Created December 20, 2013 19:04
d3 voronoi interpolation!
➕ Commits 15,865
🔀 Pull requests 1,452
🚩 Issues 917
📦 Contributed to 17
@shawnbot
shawnbot / ghost-inspector-ips.sh
Created November 10, 2021 22:01
Ghost Inspector IPs
#/bin/bash
curl -s "https://api.ghostinspector.com/v1/test-runner-ip-addresses" \
| jq -r '.data|values|.[]|.ips|.[]' \
| sort
@shawnbot
shawnbot / tokens.yml
Created April 19, 2017 21:23
Design tokens for Jekyll
colorBlue: '#00f'
colorGreen: '#0f0'
colorRed: '#f00'
@shawnbot
shawnbot / form-save.js
Last active July 29, 2021 14:54
A JavaScript snippet for temporarily saving and restoring a form's state after refreshing
// NOTE: the '#form-id' selector below will most certainly be different
// for whatever page you're on. Remember to change it in both instances!
// run this in the terminal to save the state of your form
// in your browser's LocalStorage:
[].forEach.call(document.querySelector('#form-id').elements, function(el) {
localStorage.setItem(el.name, el.value);
});
// then refresh the page and run this to restore your form values: