Skip to content

Instantly share code, notes, and snippets.

View shawnbot's full-sized avatar
🎹

Shawn Allen shawnbot

🎹
View GitHub Profile
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 / 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
➕ Commits 15,865
🔀 Pull requests 1,452
🚩 Issues 917
📦 Contributed to 17

You should rename the master branch to main in git, and on GitHub. Here's how!

1. Create your new main branch

...with one click on github.com/:owner/:repo:

image

2. Update the default branch to main in your repo's branch settings

@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 / stylelint.config.js
Created October 3, 2019 22:40
lint only some variable types
const variables = require('stylelint-config-primer/plugins/variables')
const {DEFAULT_RULES} = variables
const variableRules = {}
for (const rule of Object.keys(DEFAULT_RULES)) {
variableRules[rule] = false
}
module.exports = {
plugins: [variables],
<sticky-element class="top-0" stuck-class="top-0 bg-white" stuck-style="height: 64px">
<h1 class="h1" stuck-class="h2">
I stick to the top
</h1>
</sticky-element>
@keyframes glow {
0% { color: yellow; }
100% { color: red; }
}
@keyframes grow {
from { transform: scale(0.1); }
to { transform: scale(1); }
}
export default function extend(Component, extensions = {}) {
const {fixedProps, ...otherExtensions} = extensions
const Extended = fixedProps
? props => <Component {...props} {...fixedProps} />
: props => <Component {...props} />
return Object.assign(Extended, Component, otherExtensions)
}
@shawnbot
shawnbot / package.json
Created July 25, 2018 18:27
styled-system getter bug test case
{
"private": true,
"scripts": {
"test": "jest"
},
"dependencies": {
"babel-preset-env": "1.7.0",
"jest": "23.4.1",
"styled-system": "3.0.2"
},