Skip to content

Instantly share code, notes, and snippets.

View develpudu's full-sized avatar
💭
I may be slow to respond.

develpudu

💭
I may be slow to respond.
View GitHub Profile
@develpudu
develpudu / mac-setup.sh
Created September 18, 2025 16:56 — forked from nadirakdag/mac-setup.sh
Personal Mac Setup Script
#!/bin/bash
# Exit on error
set -e
echo "Starting macOS setup..."
# Disable Homebrew cleanup
export HOMEBREW_NO_INSTALL_CLEANUP=1
@develpudu
develpudu / context prompt.md
Created August 20, 2025 23:09 — forked from lksudha/context prompt.md
context and task prompt for ci migration

✅ CodeIgniter 4 Project — Context + Task Prompt Template

Use this format when working with ChatGPT to refactor or migrate pages to CI4. Submit the CONTEXT once, and use the TASK section for specific actions.


🧱 CONTEXT

This is a CodeIgniter 4.6 application.

@develpudu
develpudu / ci migration prompt.md
Created August 20, 2025 23:09 — forked from lksudha/ci migration prompt.md
chatgpt template for CI migration prompt

📄 Prompt Template: Legacy PHP to CodeIgniter 4.6 Page Migration

✅ Goal:

I want to migrate the legacy PHP page [legacy_page.php] to CodeIgniter 4.6.

✅ Expectations:

  • Follow MVC style used in the existing page [driver_payments.php]
  • The controller method should be named: [methodName]
  • The controller is located in: DispatchController under app/Controllers/Dispatch/Pages
  • The view is placed at: app/Views/Pages/[new_view_name].php
@develpudu
develpudu / edit_commit_history.md
Created June 8, 2025 13:59 — forked from amalmurali47/edit_commit_history.md
Change ownership of selected older commits in Git
  1. Clone the repo.
  2. Use git rebase -i --root
  3. vim will open. Select the commits you want to modify by changing pick to edit. If you would like to change all the commits, perform the following replace: :%s/^pick/edit/g. This command changes all instances of "pick" at the start of lines to "edit".
  4. You will now be shown all the selected commits one by one. Each commit message will be displayed. You have two options:
    • If you would like to keep the commit author details the same, do a git rebase --continue.
    • If you would like to change it to a different name/email, do git commit --amend --reset-author. If --reset-author is specified, it will use the details from your git config. (If you need to specify an alternate name/email, you can do so with --author="John Doe <john@example.com>". If you would like to change the time to a previous date, you can do so with --date "2 days ago".)
  5. Do the same for all the commits and finish the rebase.
  6. Perform git push -f origin master to
@develpudu
develpudu / example.js
Last active August 22, 2025 06:57 — forked from akirattii/example.js
NodeJS: How to run a process (also a shell script etc) on background separated with the parent node process.
const spawn = require('child_process').spawn;
// a command you want to execute.
const command = "node cli/hoge.js --aaa --bbb=123";
const parts = command.split(" ");
const cmd = parts[0];
const args = parts.splice(1);
// detached: true: This option makes the child process a leader of a new process group, allowing it to continue running after the parent process exits.
FROM qwen3:30b-a3b-q8_0
TEMPLATE """{{- if .Messages }}
{{- if or .System .Tools }}<|im_start|>system
{{- if .System }}
{{ .System }}
{{- end }}
{{- if .Tools }}
# Tools
@develpudu
develpudu / postgresql_export.sh
Created March 21, 2025 18:03 — forked from devjaime/postgresql_export.sh
Automatizando Exportaciones de PostgreSQL con Bash
#!/bin/bash
# Configuration variables
DB_HOST="localhost" # Database host
DB_PORT="5432" # Database port
DB_NAME="database_name" # Database name
DB_USER="db_user" # Database user
DB_PASSWORD="" # Database password (leave empty if using .pgpass)
TABLE_NAME='"table_name"' # Table to export
OUTPUT_FILE="table_export_$(date +%Y%m%d).sql" # Output file with dynamic date
@develpudu
develpudu / postgres-cheatsheet.md
Created April 11, 2024 06:48 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)

Hello Pi

This is a writedown of how I installed my raspberry pi(s).

The base is a Proxmox, so I don't have to worry about reformat the SD card every time I wanna try out something new, as I can start VMs and LXC containers, as well as Docker containers once it's configured properly.

Note: Those files are versioned, so you can always look what changed from time to time.

Topics

  • Pimox
#!/usr/bin/env bash
set -Eeuo pipefail
echo_and_run() {
echo "> $*"
"$@"
}
setup_sudo() {
# Ask for the administrator password upfront