This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const createLock = () => { | |
let promise = Promise.resolve(); | |
return { | |
async acquire(): Promise<Disposable> { | |
const { promise: next, resolve } = Promise.withResolvers<void>(); | |
const prev = promise; | |
promise = next; | |
await prev; |
We can't make this file beautiful and searchable because it's too large.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type FormatAttributes = { | |
'color'?: string; | |
'font-style'?: string; | |
'font-weight'?: string; | |
'text-decoration'?: string; | |
}; | |
export interface FormattedContent { | |
children: string | (string | FormattedContent)[]; | |
attrs: FormatAttributes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
! 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x.com##.css-175oi2r:has(> .css-175oi2r > [aria-label="Subscribe to Premium"]) | |
x.com##.css-175oi2r:has(> .css-175oi2r > [aria-label="Subscribe to Premium to write your own longer posts"]) | |
x.com##.css-175oi2r.r-1ifxtd0:has(> .css-175oi2r > .css-175oi2r > [aria-label="Timeline: Trending now"]) | |
x.com##.r-1wvb978:style(font-feature-settings: initial !important) | |
x.com##[data-testid="AppTabBar_Home_Link"] ~ :is(a[href="/i/grok"], a[href="/i/premium_sign_up"], a[href="/i/verified-orgs-signup"]) | |
x.com##div[role=dialog] > .css-175oi2r .css-175oi2r:has(> :is(a[href="/i/premium_sign_up"], a[href="/i/verified-orgs-signup"], a[href="/settings/monetization"], a[href^="https://ads.x.com/"], a[href="/jobs"])) | |
x.com##[data-testid="tweet"] .css-175oi2r:has(> a.css-175oi2r[href$="/analytics"]) | |
x.com##[data-testid="UserName"] > div:has(a[href="/i/premium_sign_up"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Signal as WebSignal } from 'signal-polyfill'; | |
export type Accessor<T> = () => T; | |
export type Setter<in out T> = { | |
<U extends T>(...args: undefined extends T ? [] : [value: (prev: T) => U]): undefined extends T | |
? undefined | |
: U; | |
<U extends T>(value: (prev: T) => U): U; | |
<U extends T>(value: Exclude<U, Function>): U; | |
<U extends T>(value: Exclude<U, Function> | ((prev: T) => U)): U; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class PromiseQueue { | |
#queue: { deferred: PromiseWithResolvers<any>; fn: () => any }[] = []; | |
#max: number; | |
#current = 0; | |
constructor({ max = 4 }: { max?: number } = {}) { | |
this.#max = max; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# - Take a screenshot of the active monitor | |
# - View said screenshot in fullscreen | |
# - Ask the user for the region to crop | |
# - Pass the crop geometry for ImageMagick to crop and copy it | |
# + Grab the active workspace's window geometries for suggested crops | |
CURRENT_OUTPUT=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; |
NewerOlder