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:
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"; |
import AppKit | |
import ApplicationServices | |
import CoreFoundation | |
import Foundation | |
// Helpers | |
// https://github.com/keith/ModMove/blob/main/ModMove/AXValue%2BHelper.swift | |
extension AXValue { | |
func toValue<T>() -> T? { |
#!/bin/sh | |
# File formatted with shell-format. | |
# | |
# This tool creates a disk image to put node_modules in. This makes it so that | |
# when the disk image is not mounted, it is treated as a single file by | |
# Spotlight and other tools to do expensive tasks on a per-file basis. | |
set -e | |
# Utils |
// ==UserScript== | |
// @name Gmail Sender Utils | |
// @namespace https://github.com/szhu | |
// @match https://mail.google.com/mail/u/* | |
// @version 1.1 | |
// @author Sean Zhu | |
// ==/UserScript== | |
// | |
// This script does two things: | |
// |
for (let image of document.querySelectorAll("image")) { | |
let url = (image.getAttribute("xlink:href")); | |
fetch(url).then(res => res.blob()).then(blob => open(URL.createObjectURL(blob))); | |
} |
#!/bin/bash | |
set -e | |
old_stash_count=$(git stash list | wc -l) | |
git stash push --keep-index --include-untracked --quiet | |
if test "$old_stash_count" == "$(git stash list | wc -l)"; then | |
echo "All changes have been committed." | |
exit 0 | |
fi |