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.
This is a CodeIgniter 4.6 application.
#!/bin/bash | |
# Exit on error | |
set -e | |
echo "Starting macOS setup..." | |
# Disable Homebrew cleanup | |
export HOMEBREW_NO_INSTALL_CLEANUP=1 |
I want to migrate the legacy PHP page [legacy_page.php]
to CodeIgniter 4.6.
[driver_payments.php]
[methodName]
DispatchController
under app/Controllers/Dispatch/Pages
app/Views/Pages/[new_view_name].php
git rebase -i --root
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".git rebase --continue
.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"
.)git push -f origin master
toconst 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 |
#!/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 |
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)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.
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
echo_and_run() { | |
echo "> $*" | |
"$@" | |
} | |
setup_sudo() { | |
# Ask for the administrator password upfront |