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://gist.github.com/chibicode/fe195d792270910226c928b69a468206?permalink_comment_id=4568681#gistcomment-4568681 | |
*/ | |
import NextImage from 'next/image'; | |
import { memo } from 'react'; | |
function Applemoji({ | |
emoji, | |
width = 72, |
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://github.com/Emiyaaaaa/next-routes-list/blob/8a91e25edcf7226b4534f11cfc04b39515162bf1/src/getNextRoutes.ts#L1 | |
*/ | |
import listPaths from 'list-paths'; | |
export function getNextRoutes( | |
src = './app', | |
fileNames = ['page', 'route'], | |
extensions = ['tsx', 'ts', 'js', 'jsx', 'md', 'mdx'] |
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; |
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
/** | |
* 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
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
#!/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(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
ffmpeg -i video.mp4 -c:v vp9 -pix_fmt yuva420p -b:v 1M -vf "fps=30,scale=512:-1" -an video.webm |
NewerOlder