Skip to content

Instantly share code, notes, and snippets.

View mary-ext's full-sized avatar
💭
dreaming of bunnies

mary mary-ext

💭
dreaming of bunnies
View GitHub Profile
diff --git a/dist/esm/index.js b/dist/esm/index.js
index 2fe5ec67e1bd5f86653cfa49a9ab40c2e75afda3..9521be9e7b4368dad9f3d73238b611f8f10a3067 100644
--- a/dist/esm/index.js
+++ b/dist/esm/index.js
@@ -2122,18 +2122,13 @@ function swap(form, name, {
/**
* Handles the lifecycle dependent state of a field or field array.
*
+ * @param getStore The field store.
* @param props The lifecycle properties.
@mary-ext
mary-ext / typescript-deno.sh
Created March 12, 2024 08:02
TypeScript LSP server launcher, launches Deno's LSP server if deno.json is detected on project folder
#!/bin/bash
if [ -f deno.json ] || [ -f deno.jsonc ]; then
~/.deno/bin/deno lsp
else
typescript-language-server --stdio
fi
@mary-ext
mary-ext / bluesky-search-convert-local-time.ts
Last active April 13, 2024 17:51
Convert Bluesky's datetime search to local time
// https://github.com/golang/go/blob/519f6a00e4dabb871eadaefc8ac295c09fd9b56f/src/strings/strings.go#L377-L425
const fieldsfunc = (str: string, fn: (rune: number) => boolean): string[] => {
const slices: string[] = [];
let start = -1;
for (let pos = 0, len = str.length; pos < len; pos++) {
if (fn(str.charCodeAt(pos))) {
if (start !== -1) {
slices.push(str.slice(start, pos));
start = -1;
// Don't check for browser defaults
user_pref("browser.shell.checkDefaultBrowser", false);
// Show compact mode UI option, and enable it.
user_pref("browser.compactmode.show", true);
user_pref("browser.uidensity", 1);
// Enable auto-scrolling
user_pref("general.autoScroll", true);
@mary-ext
mary-ext / promise-queue.ts
Last active May 11, 2024 14:09
Queued promise tasks
export class PromiseQueue {
#queue: { deferred: PromiseWithResolvers<any>; fn: () => any }[] = [];
#max: number;
#current = 0;
constructor({ max = 4 }: { max?: number } = {}) {
this.#max = max;
}
@mary-ext
mary-ext / event-emitter.ts
Last active May 11, 2024 14:09
Typed event emitter
type EventFunction = (...args: any[]) => void;
export interface EventMap {
[key: string]: EventFunction;
}
export class EventEmitter<Events extends EventMap> {
#events?: Record<keyof Events, EventFunction | EventFunction[]>;
on<E extends keyof Events>(type: E, listener: Events[E]) {
@mary-ext
mary-ext / delete-follow-orphans.ts
Last active June 14, 2024 13:32
bluesky delete orphaned follows
import { Agent } from '@externdefs/bluesky-client/agent';
import type { Records, RefOf } from '@externdefs/bluesky-client/atp-schema';
const BSKY_USERNAME = '';
const BSKY_PASSWORD = '';
const agent = new Agent({ serviceUri: 'https://bsky.social' });
await agent.login({ identifier: BSKY_USERNAME, password: BSKY_PASSWORD });
const did = agent.session!.did;
@mary-ext
mary-ext / youtube-music.txt
Last active August 8, 2024 11:37
make youtube music good ublock filter
! 72px = height of now playing bar
! 24px = spacing between now playing bar and mini player
! 226px = height of mini player
music.youtube.com##ytmusic-app-layout > #content, ytmusic-two-column-browse-results-renderer[is-bauhaus-web-album-detail-page-redesign-enabled], ytmusic-two-column-browse-results-renderer[is-bauhaus-web-playlist-detail-page-redesign-enabled]:style(padding-bottom: calc(72px + 24px * 2 + 226px) !important)
! the "default" page styling adds in a margin instead of padding
music.youtube.com##ytmusic-app-layout > #content:style(margin-bottom: 0px !important)
@mary-ext
mary-ext / web-console-formatter.ts
Last active August 15, 2024 14:50
JS console text formatter for web and Deno
export type FormatAttributes = {
'color'?: string;
'font-style'?: string;
'font-weight'?: string;
'text-decoration'?: string;
};
export interface FormattedContent {
children: string | (string | FormattedContent)[];
attrs: FormatAttributes;
@mary-ext
mary-ext / dids.csv
Created September 16, 2024 13:34
First 200k registered users on Bluesky
We can't make this file beautiful and searchable because it's too large.
did:plc:ragtjsm2j2vknwkz3zp4oxrd,2022-11-17T00:35:16.391Z
did:plc:l3rouwludahu3ui3bt66mfvj,2022-11-17T00:39:19.084Z
did:plc:vpkhqolt662uhesyj6nxm7ys,2022-11-17T01:04:43.624Z
did:plc:yk4dd2qkboz2yv6tpubpc6co,2022-11-17T01:07:13.996Z
did:plc:6uow4ajxchftgyvvppnqa6uj,2022-11-17T03:30:47.787Z
did:plc:oky5czdrnfjpqslsw2a5iclo,2022-11-17T06:31:40.296Z
did:plc:7axcqwj4roha6mqpdhpdwczx,2022-11-18T01:31:55.110Z
did:plc:6fktaamhhxdqb2ypum33kbkj,2022-11-18T03:23:32.417Z
did:plc:vzmlifz3ghar4cu2hj3srga2,2022-11-18T10:22:57.934Z
did:plc:jo6qdnxnyqdio6cq36xgc6tx,2022-11-18T11:41:49.052Z