Skip to content

Instantly share code, notes, and snippets.

Build docker image, production React + Typescript + Tailwinds + ViteJS
add to vite.config.ts:
server: {
port: 9393,
strictPort: true,
host: true,
origin: "http://0.0.0.0:9393",
},
@indraAsLesmana
indraAsLesmana / devcontainer.json
Created July 22, 2024 01:05
dev container config web development
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye",
"features": {
"ghcr.io/devcontainers/features/go:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/php:1": {},
confusion about path sdk using FVM, about global env, and per project:
https://github.com/leoafarias/fvm/issues/599
will fix with this:
export FLUTTER_HOME="$HOME/fvm/default"
proxy_flutter() {
local flutter_exec
if [[ -x "./.fvm/flutter_sdk/bin/flutter" ]]; then
copy ssh
$ssh-copy-id [email protected]
install docker
$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
$ echo "deb [arch=arm64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
@indraAsLesmana
indraAsLesmana / dev .zshrc
Created July 12, 2024 00:08
terminal running well flutter, py, firebase cli, cloudflare cli, php, node etc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/indralesmana/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/indralesmana/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/indralesmana/miniconda3/etc/profile.d/conda.sh"
else
# Raw Data Download from Github (1-10)
When downloading data from Github in your application and the content path is in the following format:
`https://github.com/prust/wikipedia-movie-data/raw/master/movies.json`
To download the data via HTTP, you can replace `https://github.com` with `https://raw.githubusercontent.com`.
The modified content path will look like this:
@indraAsLesmana
indraAsLesmana / Dev container note
Last active July 8, 2024 01:55
note when develop with dev container
Dev container note
Disable Signing for the Current Repository:
git config commit.gpgSign false
backup and restore volume:
docker run --rm \
-v ubuntu:/backup-volume \
-v "$(pwd)":/backup \
busybox \
@indraAsLesmana
indraAsLesmana / sample continue plugin configuration on vscode
Last active June 3, 2024 04:47
Sample Continue plugin using Gemini and Ollama on localhost/LAN
{
"models": [
{
"title": "Ollama",
"provider": "ollama",
"model": "codegemma:7b",
"apiBase": "http://192.168.2.63:11434"
},
{
"title": "GFlash",
@indraAsLesmana
indraAsLesmana / vanilla-html-tailwind-javascript.md
Created June 3, 2024 04:41
Best practice build vanilla html + tailwindcss + javascript

Using a CDN for Tailwind CSS directly in your HTML file isn't the best practice for production. Here's a breakdown of the problems and a recommended solution using a build process:

Problems with Direct CDN Inclusion:

  • Performance: Fetching Tailwind CSS from a CDN adds an extra HTTP request to your page load, slowing down initial rendering.
  • Bundle Size: The entire Tailwind CSS library is included in your HTML, adding unnecessary weight to your page.
  • Customization: It's not ideal for customizing Tailwind's defaults, as you'll need to modify the CDN's version directly.
  • Cache Busting: You might not have control over the caching of the CDN, leading to issues with updates.

Best Practices: Build Process (with Vite or Parcel)