Skip to content

Instantly share code, notes, and snippets.

import {
editImageBlobs,
findImageBlob,
uploadImageFile,
} from "@app/db/chat/images";
import { serverTool } from "@app/db/chat/tool-calls";
import { serverDataPart } from "@app/db/models/server-messages";
import { MessageFiles } from "@app/db/models/threads";
import { getEdgeMap } from "@app/db/opencv";
import { editImageSchema } from "@app/shared/chat/agents/main";
const refresh = `
SCOPE - Refresh
- Repaint the walls and ceiling to match the style.
- Swap loose décor only: cushions, throws, lampshades, tabletop accessories, art frames.
- Lightly adjust ambient light color temperature.
- Do NOT replace furniture pieces, cabinetry, flooring, or built-ins, windows, doors, or walls
`;
const softRemodel = `
SCOPE - Soft Remodel
import UIKit
import RiveRuntime
class RiveReactNativeView: RCTView, RivePlayerDelegate, RiveStateMachineDelegate {
// MARK: DataBinding Event Properties
weak var bridge: RCTBridge?
private var eventEmitter: RiveReactNativeEventModule? {
return self.bridge?.module(for: RiveReactNativeEventModule.self) as? RiveReactNativeEventModule
}
private var propertyListeners: [String: PropertyListener] = [:]
@zhm
zhm / restart-typescript-eslint.md
Created May 10, 2025 15:32
Keyboard shortcut to restart TypeScript and ESLint for VSCode and Cursor

Install macros extension

Add this to settings.json, cmd+shift+p Preferences: Open User Settings (JSON)

"macros": {
  "restartTypeScript": [
    "eslint.restart",
    "typescript.restartTsServer"
  ]
}

GitHub Issues in Cursor

  • Install GitHub Pull Requests extension
  • Add keybinding to open a new issue, cmd+shift+p go to Preferences: Open Keyboards Shortcuts (JSON)
  • Add this entry in the JSON:
{
  "key": "ctrl+shift+i",
 "command": "issue.createIssue",
# CLI
sudo apt update -y
sudo apt install -y \
git curl \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev mupdf mupdf-tools \
redis-tools sqlite3 libsqlite3-0 libmysqlclient-dev \
rbenv apache2-utils
@zhm
zhm / install-wkhtmltopdf.sh
Last active September 7, 2017 16:18
Install wkhtmltpdf on Linux
#!/usr/bin/sh
DOWNLOAD_URL="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz"
cd ~
wget $DOWNLOAD_URL -O ~/wkhtmltox.tar.xz
tar -xvf ~/wkhtmltox.tar.xz
@zhm
zhm / biscuits-and-gravy.md
Created December 23, 2016 23:11
Biscuits and Gravy

Biscuits

  • 1 pound White Lily self-rising flour
  • 1 1/2 cups buttermilk
  • 1/4 pound frozen butter
  • Salt + Pepper

Gravy

  • 1 pound sausage, any kind you want
module ActionController
# This module provides a method which will redirect browser to use HTTPS
# protocol. This will ensure that user's sensitive information will be
# transferred safely over the internet. You _should_ always force browser
# to use HTTPS when you're transferring sensitive information such as
# user authentication, account information, or credit card information.
#
# Note that if you are really concerned about your application security,
# you might consider using +config.force_ssl+ in your config file instead.
# That will ensure all the data transferred via HTTPS protocol and prevent
<!DOCTYPE html>
<meta charset="utf-8">
<title>Non-Contiguous Cartogram</title>
<style>
.land {
fill: #fff;
stroke: #ccc;
}