Skip to content

Instantly share code, notes, and snippets.

View Stevemoretz's full-sized avatar
🤫
Working on some private repos...

Steve Moretz Stevemoretz

🤫
Working on some private repos...
View GitHub Profile
@mattiaz9
mattiaz9 / blurhashDataURL.ts
Last active April 12, 2024 13:14
Convert blurhash to a base64 DataURL string (no canvas or node-canvas)
import { decode } from "blurhash"
export function blurHashToDataURL(hash: string | undefined): string | undefined {
if (!hash) return undefined
const pixels = decode(hash, 32, 32)
const dataURL = parsePixels(pixels, 32, 32)
return dataURL
}
@ofenstichloch
ofenstichloch / ToggleTrackPad
Last active December 13, 2021 21:36
Simple applescript to toggle the trackpad on a macbook on and off. This script uses the "Turn off Trackpad when USB Mouse is connected" feature of Mac OS. Tested on 10.12.6
tell application "System Events"
tell process "System Preferences"
try
set visible to false
end try
tell application "System Preferences"
delay 1
reveal pane id "com.apple.preference.universalaccess"
end tell
delay 1