I have summarized and compiled a list of React.JS best practices from various sources across the internet.
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 -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')" | |
# syntax = docker/dockerfile:1.4.0 | |
FROM node:20 | |
WORKDIR /root | |
RUN npm install sqlite3 |
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
# See details about Turnstile at https://blog.cloudflare.com/turnstile-private-captcha-alternative/ | |
from typing import Optional | |
import pydantic | |
import requests | |
cloudflare_secret_key: Optional[str] = None | |
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
# sh export_log.sh db_identifier | |
# If any of this commands fail, stop script. | |
set -e | |
db_identifier=$1 | |
date=$(date -v-7H +'%Y-%m-%d-%H') | |
log_file=~/Desktop/postgresql.log.$date | |
report_file=~/Desktop/out.$date.html | |
page_size=100000 |
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
# aproducer.py | |
# | |
# Async Producer-consumer problem. | |
# Challenge: How to implement the same functionality, but no threads. | |
import time | |
from collections import deque | |
import heapq | |
class Scheduler: |
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 keras | |
import numpy as np | |
from keras.datasets import cifar10 | |
from keras.applications.resnet50 import ResNet50 | |
from keras.layers import GlobalAveragePooling2D, Dense | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras.models import Model | |
from skimage.transform import resize | |
from IPython import embed |
Note: this assumes you are using ZSH shell.
Install asdf:
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
In your command-line run the following commands:
brew doctor
brew update
As configured in my dotfiles.
start new:
tmux
start new with session name:
NewerOlder