Skip to content

Instantly share code, notes, and snippets.

View aleclarson's full-sized avatar

Alec Larson aleclarson

View GitHub Profile
@aleclarson
aleclarson / rollup-typescript.md
Last active May 6, 2024 19:37
The best Rollup config for TypeScript libraries

Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking
🧐 Source maps

Install

func RCTLogError(_ message: String, _ file: String=#file, _ line: UInt=#line) {
RCTSwiftLog.error(message, file: file, line: line)
}
func RCTLogWarn(_ message: String, _ file: String=#file, _ line: UInt=#line) {
RCTSwiftLog.warn(message, file: file, line: line)
}
func RCTLogInfo(_ message: String, _ file: String=#file, _ line: UInt=#line) {
@aleclarson
aleclarson / README.md
Last active May 1, 2024 00:23
rsync-backup

Selective backup for OSX

Using the awesome rsync-time-backup script by @laurent22, OSX users can selectively backup any directory on their computer.

  1. Download rsync_tmbackup.sh into your ~/bin directory:
wget https://raw.githubusercontent.com/laurent22/rsync-time-backup/master/rsync_tmbackup.sh -O ~/bin/rsync-backup
chmod +x ~/bin/rsync-backup
@aleclarson
aleclarson / x.shift-block.userscript.js
Created April 17, 2024 22:00
Shift+Click to Block – X.com
// ==UserScript==
// @name X.com ~ Shift+Click to Block
// @namespace http://tampermonkey.net/
// @version 2024-04-10
// @description Block the tweet under the cursor using the Shift key and click.
// @author Alec Larson
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// ==/UserScript==
// ==UserScript==
// @name X.com ~ Shift+Click to Mute
// @namespace http://tampermonkey.net/
// @version 2024-04-10
// @description Mute the tweet under the cursor using the Shift key and click.
// @author Alec Larson
// @match https://twitter.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
// @grant none
// ==/UserScript==
@aleclarson
aleclarson / verbose.log
Created April 10, 2024 03:55
astro + starlight: no loader for jsonc files
> www@0.0.1 astro ~/docs/www
> astro "dev" "--verbose"
2024-04-10T03:53:28.361Z astro:cli --verbose flag enabled! Enabling: DEBUG="astro:*,vite:*"
2024-04-10T03:53:28.361Z astro:cli Tip: Set the DEBUG env variable directly for more control. Example: "DEBUG=astro:*,vite:* astro build".
2024-04-10T03:53:28.820Z astro:telemetry [notify] last notified on 1712698445704
2024-04-10T03:53:29.395Z astro:Failed to load config with Node TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for ~/docs/www/node_modules/.pnpm/@astrojs+starlight@0.21.5_astro@4.5.17/node_modules/@astrojs/starlight/index.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
// ==UserScript==
// @name Google AI Studio: Zen Mode
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Expand the chat to fill the screen.
// @author Alec Larson
// @match https://aistudio.google.com/app/prompts/*
// @grant GM_addStyle
// ==/UserScript==
// ==UserScript==
// @name Gemini Finished Notification
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Notify when Gemini is done loading a model response
// @author Claude 3
// @match https://aistudio.google.com/app/prompts/*
// @grant GM_notification
// @grant GM_getTab
// @grant GM_openInTab
@aleclarson
aleclarson / google-ai-studio-finished.userscript.js
Created April 7, 2024 20:16
Google AI Studio: Finished notification – Tampermonkey Userscript
// ==UserScript==
// @name Gemini Finished Notification
// @namespace http://tampermonkey.net/
// @version 0.3
// @description Notify when Gemini is done loading a model response
// @author Claude 3
// @match https://aistudio.google.com/app/prompts/*
// @grant GM_notification
// @grant GM_getTab
// @grant GM_openInTab
/**
* Taken from https://github.com/scrollback/juri
*
* Use of other URL-safe characters
*
* . Dot in strings
* _ Spaces in strings
*
* - Value: Start of negative number
* In numbers, negative exponent