Skip to content

Instantly share code, notes, and snippets.

View mutewinter's full-sized avatar

Jeremy Mack mutewinter

View GitHub Profile
@mutewinter
mutewinter / imageSizes.ts
Last active September 11, 2022 17:56
Utility to help generate image sizes for the Next Image component when using Tailwind via Twin.macro
import { theme } from 'twin.macro';
function minMediaCondition(minWidth: string, width: string) {
return `(min-width: ${minWidth}) ${width}`;
}
type Screens = 'sm' | 'md' | 'lg';
// We only do sizes in terms of view width
type SizeWithScreen<T extends Screens> = [screen: T, width: `${string}vw`];
@mutewinter
mutewinter / _view and save images.md
Last active July 13, 2020 15:38
View and save images from any page bookmarklet
@mutewinter
mutewinter / focusAlert.lua
Created April 9, 2018 16:51
Hammerspoon App Focus Alert
-- --------------------------
-- Alert When App Not Focused
-- --------------------------
local alertInSeconds = 60 * 20
local alertAppName = 'App You Want to Focus Here'
local alertTimer
local function stopTimerAlertTimer()
@mutewinter
mutewinter / README.md
Last active December 8, 2021 11:01
Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Prevent Double Tap Zoom in React for Rapidly Tapped Buttons

Touch delay is [a thing of the past][td], but accidental zooming is here to ruin your day. Ever tapped a button quickly on iOS and experienced a zoom instead of two taps? You're in the right place.

Before

Before

@mutewinter
mutewinter / package.json
Created October 4, 2016 21:28
Use Jest with CoffeeScript
{
"jest": {
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node",
"coffee"
],
"preprocessorIgnorePatterns": [ ],
@mutewinter
mutewinter / README.md
Last active February 8, 2018 21:16
Magic Import for Vim UltiSnips

Magic Import for Vim UltiSnips

GIF of magic import in action

  1. Be a Vim user.
  2. Install UltiSnips.
  3. Add the code below to $YOUR_VIM_FOLDER/UltiSnips/javascript.snippets.
snippet ii "magic import" b
import `!p
@mutewinter
mutewinter / sizing.md
Last active May 18, 2020 11:06
T-Shirt sizes we use for estimation at Postlight

Table

Size What it means
▁ S 💅 I can get this done in one session at the computer with no breaks
▃ M ☕ This will require breaks, less than a day
▅ L 💦 This will require more than one day
▇ XL 😱 Rare! This will require a week or more. Try breaking into multiple smaller issues
@mutewinter
mutewinter / devServer.js
Last active June 13, 2016 13:29
Minimal output from Webpack
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.config');
var PORT = process.env.PORT || 1337;
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
hot: true,
quiet: false,
@mutewinter
mutewinter / README.md
Last active December 9, 2015 19:55
Trello Userstyle to Show Label Names and Order Black Labels First
@mutewinter
mutewinter / userstyle.css
Last active September 22, 2016 15:03
My Flowdock UserStyle. Goes in ~/Library/Application Support/Flowdock/userstyle.css
.emojie {
line-height: 1rem !important;
}
.bubble.thread {
opacity: 0.65;
}
.bubble.green {
border-color: #9554D2 !important;