I hereby claim:
- I am ansont on github.
- I am ansont (https://keybase.io/ansont) on keybase.
- I have a public key ASDU_EBl_KrTegICgj2_-TdmFr4RBFlsDuA6Zada0RqK3wo
To claim this, I am signing this object:
function dir_sizes() { | |
find $1 -type d -name $2 -prune | while read line; do du -sh $line; done | |
} | |
alias ds=dir_sizes # ds {start_dir} {name_pattern} | |
# e.g. list node_modules sizes recursively | |
# ds . node_modules | |
# | |
# output: |
require 'formula' | |
class Sshpass < Formula | |
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz' | |
homepage 'http://sourceforge.net/projects/sshpass' | |
sha256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
"--prefix=#{prefix}" |
I hereby claim:
To claim this, I am signing this object:
# ----------------------------------------------- | |
# Loops | |
# ----------------------------------------------- | |
aList = ['apple', 'orange', 'pear'] | |
## print all fruits | |
for fruit in aList: | |
print(fruit) | |
## skip 'apple' |
import { NextApiRequest, NextApiResponse } from 'next' | |
import { Readable } from 'node:stream' | |
export default async function handler(req: NextApiRequest, res: NextApiResponse) { | |
const { authorization } = req.headers | |
if (!authorization || authorization !== process.env.AUTHORIZATION_HEADER) { | |
return res.status(401).json({ error: 'Unauthorized' }) | |
} | |
const openAIUrl = process.env.OPENAI_URL as string |
const AutoScrollList: FC<ListProps> = (props) => { | |
const listRef = useRef<FlatList>() | |
const [contentHeight, setContentHeight] = useState<number>() | |
useEffect(() => { | |
if (props.data?.lenngth > 0) { | |
listRef.current?.scrollToOffset({ offset: contentHeight }) | |
} | |
}, [props.data, contentHeight]) |