for f in "$@"; do
cp "$f" /tmp/image
/opt/homebrew/bin/convert /tmp/image -trim +repage "$f"
done
Source: https://ultracrepidarian.phfactor.net/2022/03/09/controlling-the-logitech-litra-on-macos/
Instead of using Shortcuts, I use xbar.app
Replace the awesome build-and-push functionality we lost with Docker Hub automatically building images from GitHub repos and publishing them.
Example:
This file contains hidden or 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 { graphql } = require("@octokit/graphql") | |
const REPO_OWNER = "xxxxxx" | |
const REPO_NAME = "xxxxxx" | |
const PROJECT_NUMBER = 2 | |
const COLUMN_TO_SORT = /To Do/ | |
const api = graphql.defaults({ | |
headers: { | |
authorization: `token ${process.env.GITHUB_TOKEN}`, |
This file contains hidden or 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 | |
export PATH="$HOME/bin:$PATH" | |
iface="$(route get 1.1.1.1 2>/dev/null | grep interface | perl -ple 's/\s*interface:\s*//')" | |
if [ $? != 0 ]; then | |
iface="n/a" | |
fi | |
case "$iface" in |
This file contains hidden or 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
import { encode } from "html-entities" | |
import { getReasonPhrase, StatusCodes } from "http-status-codes" | |
import stringify from "json-stringify-safe" | |
import { NextApiResponse } from "next" | |
// Semantic sugar for returning various status codes, optionally with messages. | |
export const statusHelper = (res: NextApiResponse) => ({ | |
codes: StatusCodes, | |
status(code: number, message?: string): void { | |
const phrase = getReasonPhrase(code) |
This file contains hidden or 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
import React, { | |
createContext, | |
ReactNode, | |
useCallback, | |
useContext, | |
useRef, | |
useState, | |
} from "react" | |
import { | |
Button, |
This file contains hidden or 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 fetch = require('./fetch') | |
const RED = '#cd3131' | |
const YELLOW = '#e5e512' | |
const GREEN = '#05bc79' | |
const BLUE = '#2472c8' | |
exports.handler = async function(event, context) { | |
// Debugging | |
// console.log('event', JSON.stringify(event, null, 2)) |
This file contains hidden or 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
# ------------------------------ | |
# * Dependencies | |
FROM node:16.13.0-alpine3.14 AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json yarn.lock ./ | |
RUN yarn install --frozen-lockfile |
This file contains hidden or 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
/* | |
* Usage: | |
* const { alert, confirm, prompt } = useModals() | |
* alert("Hey!") // awaitable too | |
* if (await confirm("Are you sure?")) ... | |
* const result = await prompt("Enter a URL", "http://") | |
*/ | |
import React, { | |
createContext, |