This code:
1 formResults = { ... };
2 console.log("first name: " + formResults.firstName);
3 console.log("last name: " + formResults.lastName);
4 console.log("email: " + formResults);
has the following output:
#!/opt/homebrew/bin/bun run | |
// <xbar.title>CPU Usage, Kill process</xbar.title> | |
// <xbar.version>v1.0</xbar.version> | |
// <xbar.author>Sean Zhu</xbar.author> | |
// <xbar.author.github>szhu</xbar.author.github> | |
// <xbar.desc>Shows the top 5 highest-CPU processes. Select a process to kill it.</xbar.desc> | |
// <xbar.image>https://raw.githubusercontent.com/Aleksandern/devman/master/images/BitBarCpuUsageKill.png</xbar.image> | |
// <xbar.dependencies>deno</xbar.dependencies> | |
// Based on: https://xbarapp.com/docs/plugins/System/cpu-usage-kill.5s.sh.html |
type PickByNullableType<D, T> = { | |
[K in keyof D]: NonNullable<D[K]> extends T ? K : never; | |
}; | |
type PickKeysWithNullableValueTypes<D, T> = keyof D & | |
PickByNullableType<D, T>[keyof D]; | |
function setLevel1Value<D extends object, K1 extends keyof D>( | |
data: D, | |
key1: K1, |
# This does a dry run; it prints out what should be run. You can then run it yourself. | |
for branch in (git branch --format "%(refname:short)") | |
set sha (git rev-parse $branch) | |
if git log -1 $branch --pretty=format:'%cr' | grep -q -E 'weeks|months' | |
set date (git log -1 $branch --pretty=format:'%cs') | |
echo | |
echo '#' $branch | |
echo git tag $date-$branch $sha | |
echo git branch -D $branch | |
end |
set -e | |
verbose() { | |
echo $ "$@" >&2 | |
"$@" | |
} | |
COMPARISON="${1:-origin/prod...origin/main}" | |
OUT=".git/changelog.out.html" |
import { useRef } from "react"; | |
/** | |
* Use this hook to quickly answer the question: Why did my useEffect or useMemo | |
* callback run again? | |
* | |
* Usage: | |
* | |
* // If you have this code... | |
* useEffect(() => { |
This code:
1 formResults = { ... };
2 console.log("first name: " + formResults.firstName);
3 console.log("last name: " + formResults.lastName);
4 console.log("email: " + formResults);
has the following output:
-- https://forum.kicad.info/t/zoom-with-scroll-wheel-but-pan-with-trackpad-on-macos/11974 | |
figmaScrollToZoom = hs.eventtap.new({hs.eventtap.event.types.scrollWheel}, function(e) | |
-- Trackpad scroll events are continuous, mouse scroll events are not. | |
if 0 == e:getProperty(hs.eventtap.event.properties.scrollWheelEventIsContinuous) then | |
local front = hs.application.frontmostApplication() | |
if "Figma" == front:name() then | |
-- local title = front:focusedWindow():title() | |
-- if "Eeschema" == title:sub(0, 8) or "Pcbnew" == title:sub(0, 6) then | |
local flags = e:getFlags() |
#!/bin/bash | |
# Add thumbnails to images. This works well for document images (like PDFs), | |
# where the top of the image is the most important. | |
for file in "$@"; do | |
# `--cropOffset 0 0` doesn't do anything, so we use a small offset. | |
sips \ | |
-s format png \ | |
--resampleWidth 512 \ | |
--cropOffset 0 0.001 \ |
// 1. Export the file to PDF. | |
// | |
// 2. Convert it to SVG: | |
// | |
// inkscape $file.pdf -o $file.svg --export-text-to-path | |
// | |
// Note: Don't use pdftocairo or pdf2svg; they don't work properly with the next steps. | |
// | |
// 3. Open the SVG file in your browser. | |
// |
// ==UserScript== | |
// @name Summarize Page Text | |
// @namespace https://github.com/szhu | |
// @description Use OpenAI GPT-3 to summarize the text on the page into 3 key points. | |
// @match *://*/* | |
// ==/UserScript== | |
// @ts-strict | |
const API_KEY = "API_KEY"; |