This file contains hidden or 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
matches: | |
- label: "Trigger: ;url\n\n\n \r```text\n \r$($HOME/.local/bin/mise which deno) run --allow-read $HOME/dotfiles/espanso/main.ts url --value \"$ESPANSO_CLIPBOARD\"\n \r```\n " | |
replace: '{{url}}' | |
trigger: ;url | |
vars: | |
- name: clipboard | |
type: clipboard | |
- name: url | |
params: | |
cmd: >- |
This file contains hidden or 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 { | |
add, | |
set, | |
format, | |
startOfWeek, | |
endOfWeek, | |
eachDayOfInterval, | |
isBefore, | |
} from "npm:date-fns"; |
This file contains hidden or 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 { useSyncExternalStore } from "react"; | |
type Fn<T> = (a: T) => unknown | |
class Store<T extends object> { | |
private snapshot: [state: T, instance: this]; | |
private subscribers = new Set<Fn<T>>(); | |
constructor(private state: T) { | |
this.snapshot = [this.state, this]; |
This file contains hidden or 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 { formToJson } from "brouther"; | |
import React, { useCallback, useEffect, useRef, useState } from "react"; | |
import { AllPaths, Is, setPath } from "sidekicker"; | |
import { z, ZodArray, ZodNumber } from "zod"; | |
import { formReset, InputProps } from "~/components"; | |
export const convertPath = (path: string) => path.replace("[", ".").replace("]", "").split("."); | |
export const getSchemaShape = <T extends z.ZodObject<any>>(name: string, schema: T) => | |
convertPath(name).reduce((acc, el) => { |
This file contains hidden or 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 axios from "axios"; | |
export type Country = { | |
name: Name; | |
tld?: string[]; | |
cca2: string; | |
ccn3?: string; | |
cca3: string; | |
cioc?: string; | |
independent?: boolean; |
This file contains hidden or 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 fs from "fs"; | |
import ts from "typescript"; | |
const isType = (node: ts.Node) => | |
ts.isTypeAliasDeclaration(node) || | |
(ts.isInterfaceDeclaration(node) && node.name && node.name); | |
type DocEntry = { | |
name?: string; | |
fileName?: string; |
This file contains hidden or 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 { formatISO,parse } from "date-fns"; | |
const getUtcDate = (date: Date) => { | |
const r = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})/; | |
const [, ...s] = r.exec(date.toISOString())!; | |
return (Date.UTC as any)(...s); | |
}; | |
const parseFromFormat = (strDate: string, format: string) => { | |
const p = parse("2020.10.06 09:24:06", "yyyy.MM.dd HH:mm:ss", new Date()); | |
const utc = getUtcDate(p); |
This file contains hidden or 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 { assocPath } from "ramda"; | |
import { useClassNames } from "hulks"; | |
import React, { | |
Fragment, | |
useCallback, | |
useEffect, | |
useMemo, | |
useState, | |
} from "react"; | |
import { Arrow } from "./arrow"; |
This file contains hidden or 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 axios, { AxiosInstance, AxiosRequestConfig, AxiosStatic, CancelTokenSource } from "axios"; | |
import { useCallback, useEffect, useMemo, useRef } from "react"; | |
type Tokens = { [k: string]: CancelTokenSource | undefined }; | |
const createUid = () => Math.random().toString(36).substring(16); | |
type Http = "get" | "head" | "options" | "delete"; | |
type HttpBody = "post" | "put" | "patch"; |
NewerOlder