Skip to content

Instantly share code, notes, and snippets.

View letam's full-sized avatar
🐢
vibing

Tam Le letam

🐢
vibing
View GitHub Profile
@letam
letam / dhammapada-first-verses.md
Last active September 4, 2025 15:15
First Verses of the Dhammapada

First Verses of the Dhammapada

Source of the verses: https://www.buddhanet.net/e-learning/buddhism/dp01/

The following is a copy of a conversation between ChatGPT & Anonymous. Generated on 2025-07-31T01:02:11.571617Z

What are the first verses of the dhammapada?

The first verses of the Dhammapada appear in Chapter 1: The Twin Verses (Yamaka Vagga). These verses set the tone for the entire text by emphasizing the power of the mind in shaping one's experience. Here are the first two verses, traditionally presented as a pair:

@letam
letam / ble_read_characteristics.py
Created August 21, 2025 01:00
BLE: Read Characteristics from device
#!/usr/bin/env python
# Read characteristics from a BLE device
# Dependencies: bleak https://github.com/hbldh/bleak
# Char specifiers taken from: https://gist.github.com/ariccio/2882a435c79da28ba6035a14c5c65f22
import argparse
import asyncio
from bleak import BleakClient
@letam
letam / restful-meditations.md
Last active August 7, 2025 03:21
Restful Meditations
@letam
letam / app.config.ts
Created August 5, 2025 19:39
Transform Expo app's config file from app.json to app.config.ts for bluetooth connectivity
/*
* Reference: https://docs.expo.dev/config-plugins/plugins/
*/
import 'tsx/cjs'
import type { ExpoConfig } from 'expo/config'
module.exports = ({ config }: { config: ExpoConfig }) => {
return {
name: 'mobile-app',
slug: 'mobile-app',
@letam
letam / sublime-merge-edit-with-vscode.md
Created July 30, 2025 16:53
Sublime Merge: Set editor to be VSCode

Configure Sublime Merge to open files with VSCode (or Cursor/Windsurf)

Editor Path

/usr/local/bin/code

Editor Argument Format

-g ${file}:${line}:${col}
@letam
letam / pycharm
Last active November 28, 2023 19:56
pycharm setup for sublime merge
#!/bin/sh
open -na "PyCharm.app" --args "$@"
# # Notes for PyCharm command-line launcher script:
# ## Installation (Ref: https://www.jetbrains.com/help/pycharm/working-with-the-ide-features-from-command-line.html):
# Place this file in: /usr/local/bin/pycharm
@letam
letam / darknight.py
Created August 10, 2023 14:09
iTerm2 console script to change color preset based on time
#!/usr/bin/env python3.7
# Daemon script for iTerm2, to change color preset based on time of day
# Simpler than https://iterm2.com/python-api/examples/darknight.html#darknight-example
import asyncio
import datetime
import iterm2
@letam
letam / rm-docker-files.sh
Created July 6, 2023 16:54
Remove docker installation-related files on macOS
sudo rm /usr/local/bin/docker*
sudo rm /usr/local/bin/hub-tool
sudo rm /usr/local/bin/kubectl*
sudo rm /usr/local/bin/vpnkit
sudo rm /usr/local/bin/com.docker.cli
@letam
letam / venv-path-replace.sh
Created May 9, 2023 01:25
Replace venv path in files
#!/usr/bin/env bash
new_venv_path=/Users/tams/code/django-app-starter/.venv
old_venv_path=`tail -1 ./.venv/pyvenv.cfg | cut -d' ' -f6`
echo Old venv path is at: $old_venv_path
echo Files containing path:
for x in `grep -rnw . -e "$old_venv_path" --binary-files=without-match | cut -d: -f1`;
do echo $x
sed -i "s|$old_venv_path|$new_venv_path|g" $x
@letam
letam / chatgpt-modify-page.js
Created April 13, 2023 04:58
Script to modify/cleanup ChatGPT UI for screencasts
// Declare reusable variable
let x;
// Hide Sidebar
document.querySelector('.dark.bg-gray-900').classList.toggle('md:hidden');
// Fix app alignment
document.querySelector('.flex.h-full.flex-1').classList.toggle('md:pl-[260px]')