check which port postgres is working on:
# check the log
tail /var/log/postgresql/postgresql-14-main.log
# or check the cluster list
pg_lsclusters
/** | |
* 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'; |
/** | |
* 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'; |
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; |
#!/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(); |
ffmpeg -i video.mp4 -c:v vp9 -pix_fmt yuva420p -b:v 1M -vf "fps=30,scale=512:-1" -an video.webm |
import type { Props, Plugin, LifecycleHooks } from 'tippy.js'; | |
// eslint-disable-next-line @typescript-eslint/no-empty-interface | |
interface CustomProps {} | |
type FilteredProps = CustomProps & | |
Omit<Props, keyof CustomProps | keyof LifecycleHooks>; | |
type ExtendedProps = FilteredProps & LifecycleHooks<FilteredProps>; |
check which port postgres is working on:
# check the log
tail /var/log/postgresql/postgresql-14-main.log
# or check the cluster list
pg_lsclusters
const git = require('nodegit'); | |
const pathToRepo = require("path").resolve("./.git"); | |
const uniqBy = require('../../utils').uniqBy | |
let $repo = null; | |
/** Blame last file change | using commit id */ | |
async function blameLast_old(filePath, callback) { | |
const repo = $repo ? $repo : await git.Repository.open(pathToRepo); | |
const blame = await git.Blame.file(repo, filePath.slice(2)); |