Skip to content

Instantly share code, notes, and snippets.

View zherring's full-sized avatar

Zach Herring zherring

  • zachherring.com
  • Boulder, CO
View GitHub Profile
@dgca
dgca / typescript-png-pixel-art-generator.ts
Last active July 3, 2024 01:09
Zero dependency function to generate an image in PNG format and return it as a base64-encoded string
/**
* Generates an image in PNG format and returns it as a base64-encoded string.
*
* @param colors - An array of color values
* @param pixels - An array of pixel values
* @param width - The width of the image
* @param height - The height of the image
* @param scale - The scale factor to apply to the image (default: 1, uses nearest-neighbor interpolation)
* @returns The base64-encoded string representation of the generated image
*/
@reefdog
reefdog / Text Substitutions.plist
Last active August 3, 2022 19:55
Useful text substitutions for macOS. Install by dragging into "System Preferences > Keyboard > Text" substitution area.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>phrase</key>
<string>★☆☆☆☆</string>
<key>shortcut</key>
<string>/1star</string>
</dict>