Skip to content

Instantly share code, notes, and snippets.

@indraAsLesmana
indraAsLesmana / setup_gpg
Last active December 26, 2024 14:26 — forked from cdalvaro/gpg-with-key
Setting up GPG signature on macOS Sonoma for IDE IntelliJ and XCode
# Install gpg tools
https://gpgtools.org
# Install gpg
brew install gpg
# Generating and exporting
gpg --gen-key
gpg --armor --export <email> > ~/.backups/gpg_git_public.key
gpg --armor --export-secret-key <email> > ~/.backups/gpg_git_private.key
@indraAsLesmana
indraAsLesmana / gist:da9be0ec7ce65aada765c34b97ba87f5
Created January 20, 2024 11:12
Error install xdebug on Mac
Install using ```pecl install xdebug```
and got error something like this:
Warning: mkdir(): File exists in System.php on line 294
PHP Warning: mkdir(): File exists in /opt/homebrew/Cellar/php/8.2.12_1/share/php/pear/System.php on line 294
Warning: mkdir(): File exists in /opt/homebrew/Cellar/php/8.2.12_1/share/php/pear/System.php on line 294
ERROR: failed to mkdir /opt/homebrew/Cellar/php/8.2.12_1/pecl/20220829
simply fix with this:
@indraAsLesmana
indraAsLesmana / TapGestureRecognizerWithoutSelector.swift
Created February 13, 2024 02:24 — forked from saoudrizwan/TapGestureRecognizerWithoutSelector.swift
Easily create tap gesture recognizers for any view using closures as actions instead of selectors.
import UIKit
extension UIView {
// In order to create computed properties for extensions, we need a key to
// store and access the stored property
fileprivate struct AssociatedObjectKeys {
static var tapGestureRecognizer = "MediaViewerAssociatedObjectKey_mediaViewer"
}
@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)

@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 / 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 \
# 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 .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
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