Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeremy Mack mutewinter

View GitHub Profile
@mutewinter
mutewinter / imageSizes.ts
Last active Dec 2, 2021
Utility to help generate image sizes for the Next Image component when using Tailwind via Twin.macro
View imageSizes.ts
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 / focusAlert.lua
Created Apr 9, 2018
Hammerspoon App Focus Alert
View focusAlert.lua
-- --------------------------
-- 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 Dec 8, 2021
Prevent Double Tap Zoom in React for Rapidly Tapped Buttons
View README.md

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 Oct 4, 2016
Use Jest with CoffeeScript
View package.json
{
"jest": {
"moduleFileExtensions": [
"js",
"json",
"jsx",
"node",
"coffee"
],
"preprocessorIgnorePatterns": [ ],
@mutewinter
mutewinter / README.md
Last active Feb 8, 2018
Magic Import for Vim UltiSnips
View README.md

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
T-Shirt sizes we use for estimation at Postlight
View sizing.md

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 Jun 13, 2016
Minimal output from Webpack
View devServer.js
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 Dec 9, 2015
Trello Userstyle to Show Label Names and Order Black Labels First
@mutewinter
mutewinter / userstyle.css
Last active Sep 22, 2016
My Flowdock UserStyle. Goes in ~/Library/Application Support/Flowdock/userstyle.css
View userstyle.css
.emojie {
line-height: 1rem !important;
}
.bubble.thread {
opacity: 0.65;
}
.bubble.green {
border-color: #9554D2 !important;