This file contains 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 python3 | |
# | |
# Usage: python3 uber.py ~/Downloads/Takeout/Mail/Uber.mbox | |
# | |
# Dependencies: Python 3.4+ | |
# | |
# How to get the .mbox export: | |
# | |
# In Gmail, create a filter that applies the label "Uber" to emails matching: | |
# |
This file contains 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
/** | |
* Parses ICU message syntax into an AST. | |
* Supports these features: | |
* - Apostrophe escapes (uses DOUBLE_OPTIONAL mode). | |
* - {simple} substitution. | |
* - {var, type} substitution. | |
* - {var, type, format} substitution, where format can contain complex nesting | |
* of additional ICU messages, for example: | |
* “I’ve invited {n, plural, offset:1 | |
* =0 {nobody!} |
This file contains 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 | |
# | |
# Author: Brian Beck <exogen@gmail.com> | |
# Usage: watch PATH COMMAND... | |
# | |
# This script watches PATH and runs COMMAND whenever PATH or a descendent | |
# of PATH is modified. COMMAND is everything after the first argument. | |
# | |
# If PATH is "-", then the list of paths comes from standard input. | |
# |
This file contains 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
// This is based on some transpiled Babel code causing the `default` export | |
// to be undefined. If you look at the ultimate code that ends up in the Next.js | |
// bundle, `Object` method references are changed to strange `@babel/runtime` | |
// references, which seems to potentially cause a circular import (?) resulting | |
// in it being undefined. | |
exports.__esModule = true; | |
exports.default = DebugProvider; | |
exports.DebugContext = void 0; | |
var _react = _interopRequireWildcard(require("react")); |
This file contains 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
// Default mixin settings | |
@spinner-default-color: #000; | |
@spinner-default-size: 16px; | |
// Opacity, spacing, speed | |
@spinner-opacity: 70%; // Opacity of the brightest dot | |
@spinner-decay: 0.7; // Opacity of each dot compared to the previous | |
@spinner-spacing: 1; // Distance multiplier between dots | |
@spinner-duration: 1s; // Time it takes for one revolution |
This file contains 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 bash | |
# | |
# Determine divergence from create-react-app! | |
# Use this if you've ejected from create-react-app and want to see how its | |
# latest output would differ in key areas (package.json, config, scripts). | |
# | |
# - Assumes you can run create-react-app, so make sure it's installed. | |
# - Only shows files you've modified or removed from create-react-app. | |
# - Runs $FORMAT_COMMAND below on the create-react-app directory so formatting | |
# differences don't show up. Use something like Prettier, eslint --fix, etc. |
This file contains 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
const express = require('express') | |
const graphqlHTTP = require('express-graphql') | |
const makeExecutableSchema = require('graphql-tools').makeExecutableSchema | |
const schema = makeExecutableSchema({ | |
typeDefs: ` | |
type Query { | |
user: User | |
} |
This file contains 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
/* | |
* WebKit (possibly others; Firefox looks fine) does a bad job of scaling an | |
* SVG's aspect ratio such that its contents fill the extent of the space | |
* horizontally. If you're letting the browser determine the dimensions of your | |
* SVG, including the aspect ratio (e.g. by setting a percentage width and using | |
* `height: auto`), then you probably want to use `preserveAspectRatio="none"` | |
* in your SVG for the best results. But if you can't do that, you can at least | |
* bump up the SVG's height just enough for it to fill the `img` horizontally, | |
* letting the browser add the leftover padding to the top and bottom rather | |
* than the sides. |
This file contains 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
// Put this file at ~/Library/KeyBindings/DefaultKeyBinding.dict | |
// You may need to run: mkdir ~/Library/KeyBindings | |
{ | |
"~[" = (insertText:, "\U2018"); // Option-[ inserts left single quote | |
"~]" = (insertText:, "\U2019"); // Option-] inserts right single quote | |
"~{" = (insertText:, "\U201c"); // Option-Shift-[ inserts left double quote | |
"~}" = (insertText:, "\U201d"); // Option-Shift-] inserts right double quote | |
} |
This file contains 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 | |
# rgb2hex -- Convert RGB values to hex and copy the result to the clipboard (Mac) | |
# usage: rgb2hex [r] [g] [b] | |
hex=$(python -c "print '#%02x%02x%02x' % (${1:-0}, ${2:-0}, ${3:-0})") | |
echo -n $hex | pbcopy | |
echo $hex |
NewerOlder