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 zx | |
const branch = (await $`git branch --show-current`).stdout.trim(); | |
if (branch === "debug") { | |
const currentVersion = ( | |
await $`awk '/version/{gsub(/("|",)/,"",$2);print $2}' package.json` | |
).stdout.trim(); | |
const date = new Date(); |
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
function doSmthing() { | |
var videoEl = document.querySelector("video"); | |
videoEl.setAttribute("controls", ""); | |
var prevRotate = 0; | |
if (videoEl.style.transform) | |
prevRotate = parseInt(videoEl.style.transform.split("(")[1].slice(0, -4)); | |
document.body.style.cssText = ` | |
rotate: ${prevRotate + 90}deg; |
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
/** | |
* adopted from: https://stackoverflow.com/a/77146678/5863267 | |
*/ | |
// directory structure for this code was: | |
// file: /app/(api)/thumb/ellipsis/route.tsx | |
// font file: /assets/fonts/<font> | |
import { readFile } from 'node:fs/promises'; | |
import { join } from 'node:path'; |
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
/** | |
* Adopted from an internal component of Radix-ui | |
* | |
* @link https://github.com/radix-ui/website/blob/6cf13bab6e56e8814f8e5cac156587c0fefe994d/components/marketing/Carousel.tsx | |
*/ | |
'use client'; | |
import { useCallback, useEffect, useRef, useState } from 'react'; | |
import debounce from 'lodash.debounce'; |
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 { AsyncStorage, SyncStorage } from 'jotai/vanilla/utils/atomWithStorage'; | |
type Unsubscribe = () => void; | |
type Subscribe<Value> = ( | |
key: string, | |
callback: (value: Value) => void, | |
initialValue: Value | |
) => Unsubscribe; |
OlderNewer