Skip to content

Instantly share code, notes, and snippets.

View isDipesh's full-sized avatar

Dipesh Acharya isDipesh

View GitHub Profile
@isDipesh
isDipesh / sqlite-to-cloudflare-d1-import.md
Created December 22, 2025 06:25
Importing SQLite to Cloudflare D1

Importing SQLite to Cloudflare D1

Dump SQLite to Sql

sqlite3 -escape off server/db/db.sqlite .dump > db.sql

Escape off prevents unistr in newer versions of sqlite, which D1 does not support.

Cleanup SQL Dump

  • Remove BEGIN TRANSACTION; and COMMIT; from the file
@isDipesh
isDipesh / drizzle-pagination.ts
Last active December 18, 2025 13:06
Drizzle Pagination Util
import { count } from 'drizzle-orm'
const DEFAULT_PAGE_SIZE = 20
const MAX_PAGE_SIZE = 200
type PaginateableQuery<TQuery> = {
limit: (limit: number | undefined) => PaginateableQuery<TQuery>
offset: (offset: number | undefined) => PaginateableQuery<TQuery>
orderBy: (orderBy: string) => PaginateableQuery<TQuery>
}
@isDipesh
isDipesh / drizzle-pagination-nuxt-nitro.ts
Last active December 18, 2025 13:06
Drizzle Query Pagination Util for Nitro/Nuxt
import type { H3Event } from 'h3'
import { count } from 'drizzle-orm'
const DEFAULT_PAGE_SIZE = 20
const MAX_PAGE_SIZE = 200
type PaginateableQuery<TQuery> = {
limit: (limit: number | undefined) => PaginateableQuery<TQuery>
offset: (offset: number | undefined) => PaginateableQuery<TQuery>
orderBy: (orderBy: string) => PaginateableQuery<TQuery>
@isDipesh
isDipesh / pg-upgrade.sh
Last active November 24, 2025 10:19
Postgres cluster upgrade for new Postgres version on Arch linux
# If postgis is used
yay -S postgis-old-upgrade
sudo su
systemctl stop postgresql
mv /var/lib/postgres/data /var/lib/postgres/olddata
mkdir /var/lib/postgres/data /var/lib/postgres/tmp
chown postgres:postgres /var/lib/postgres/data /var/lib/postgres/tmp
sudo su postgres
cd /var/lib/postgres/tmp
# Use --no-data-checksums if pg was initialized without page checksums
@isDipesh
isDipesh / install-chrome-shortcut.sh
Created August 3, 2025 05:44
Chrome Shortcut App for Gnome to use X11
sudo tee /usr/share/applications/google-chrome.desktop > /dev/null << 'EOF'
[Desktop Entry]
Version=1.0
Name=Google Chrome
GenericName=Web Browser
Comment=Access the Internet
StartupWMClass=Google-chrome
Exec=/usr/bin/google-chrome-stable --ozone-platform=x11 %U
StartupNotify=true
Terminal=false
@isDipesh
isDipesh / setup-devanagari-fonts.sh
Created April 23, 2025 08:10
Setup Devanagari Fonts on (Arch) Linux
#!/bin/bash
set -e
echo "📦 Installing recommended Devanagari fonts..."
sudo pacman -S --needed noto-fonts noto-fonts-cjk noto-fonts-extra --noconfirm
echo "🛠 Creating Fontconfig override for Hindi and Nepali..."
mkdir -p ~/.config/fontconfig
@isDipesh
isDipesh / tray-app-indicators-gnome.sh
Created January 21, 2025 07:44
Tray Icons (App Indicators) extension for Gnome on Arch
sudo pacman -S meson jq
git clone https://github.com/ubuntu/gnome-shell-extension-appindicator.git
meson gnome-shell-extension-appindicator /tmp/g-s-appindicators-build
ninja -C /tmp/g-s-appindicators-build install
gnome-extensions enable appindicatorsupport@rgcjonas.gmail.com
@isDipesh
isDipesh / guake.md
Created January 21, 2025 06:22
Guake Configuration

Install

sudo pacman -S guake

Enable Toggle

Open Settings app
Keyboard => Keyboard Shortcuts => View and Customize Shortcuts => Custom Shortcuts => +:
Name: Guake Toggle

@isDipesh
isDipesh / dev.sh
Last active January 20, 2025 14:25
Development Environment Setup on Arch Linux
# Install common applications
sudo paman -S zsh guake zellij libreoffice-still gimp inkscape calibre vscode postgresql redis
yay -S anydesk-bin google-chrome telegram-desktop
# Oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# zsh plugins
sudo pacman -S zsh-syntax-highlighting
echo "source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
@isDipesh
isDipesh / gnome-clipboard.sh
Created October 6, 2024 07:13
Install Clipboard Indicator for Gnome
#!/bin/bash
rm -rf ~/.local/share/gnome-shell/extensions/clipboard-indicator@tudmotu.com
git clone https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator.git ~/.local/share/gnome-shell/extensions/clipboard-indicator@tudmotu.com
gnome-extensions enable clipboard-indicator@tudmotu.com