Skip to content

Instantly share code, notes, and snippets.

@sawirricardo
sawirricardo / cloud-init.yaml
Created May 12, 2026 09:04
Cloud Init Config
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: false
ssh_pwauth: false
write_files:
- path: /etc/bootstrap-secrets.env
owner: root:root
permissions: '0600'
@sawirricardo
sawirricardo / install.sh
Last active May 12, 2026 07:26
install codex on vps linux
sh -c 'set -e; mkdir -p "$HOME/.local/bin"; a=$(uname -m); case "$a" in x86_64|amd64) t=x86_64-unknown-linux-musl;; aarch64|arm64) t=aarch64-unknown-linux-musl;; *) echo "unsupported arch: $a" >&2; exit 1;; esac; d=$(mktemp -d); curl -fL "https://github.com/openai/codex/releases/latest/download/codex-$t.tar.gz" | tar -xz -C "$d"; mv "$d/codex-$t" "$HOME/.local/bin/codex"; chmod +x "$HOME/.local/bin/codex"; p='\\export PATH="$HOME/.local/bin:$PATH"'\\; touch "$HOME/.bashrc"; grep -qxF "$p" "$HOME/.bashrc" || printf "\n%s\n" "$p" >> "$HOME/.bashrc"; export PATH="$HOME/.local/bin:$PATH"; codex --version'
@sawirricardo
sawirricardo / default.md
Created September 9, 2025 14:30 — forked from cablej/default.md
Cluely System prompt

<core_identity> You are an assistant called Cluely, developed and created by Cluely, whose sole purpose is to analyze and solve problems asked by the user or shown on the screen. Your responses must be specific, accurate, and actionable. </core_identity>

<general_guidelines>

  • NEVER use meta-phrases (e.g., "let me help you", "I can see that").
  • NEVER summarize unless explicitly requested.
  • NEVER provide unsolicited advice.
  • NEVER refer to "screenshot" or "image" - refer to it as "the screen" if needed.
  • ALWAYS be specific, detailed, and accurate.
@sawirricardo
sawirricardo / indo_regions.csv
Last active June 15, 2025 15:52
indo regions
We can't make this file beautiful and searchable because it's too large.
id,name,parent_id
11,ACEH,
11.10,BIREUEN,11
11.10.010,SAMALANGA,11.10
11.10.010.001,MEURAH,11.10.010
11.10.010.002,"COT MEURAK BLANG",11.10.010
11.10.010.003,"BATEE ILIEK",11.10.010
11.10.010.005,"COT MEURAK BAROH",11.10.010
11.10.010.006,"MESJID BARO",11.10.010
11.10.010.007,DARUSSALAM,11.10.010
@sawirricardo
sawirricardo / dbwipe.sql
Created May 23, 2025 02:18
better alternative and more efficient db:wipe for postgres
--This is more efficient than cleaning views, tables and types like `db:wipe` does.
--This cleans up the whole schema, removing custom functions as well.
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
COMMENT ON SCHEMA public IS 'standard public schema';
@sawirricardo
sawirricardo / AppServiceProvider.php
Last active June 2, 2025 23:02
Better defaults for your laravel projects, inspired by Nuno Maduro
<?php
namespace App\Providers;
use Carbon\CarbonImmutable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\URL;
@sawirricardo
sawirricardo / Dockerfile
Last active April 16, 2025 05:04
Deploy Laravel app to Coolify or any docker-compose deployment
# Versions
# https://hub.docker.com/r/serversideup/php/tags?name=8.4-fpm-nginx-alpine
ARG SERVERSIDEUP_PHP_VERSION=8.4-fpm-nginx-alpine
# https://github.com/minio/mc/releases
ARG MINIO_VERSION=RELEASE.2025-03-12T17-29-24Z
# https://github.com/cloudflare/cloudflared/releases
ARG CLOUDFLARED_VERSION=2025.2.0
# https://www.postgresql.org/support/versioning/
ARG POSTGRES_VERSION=17
@sawirricardo
sawirricardo / index.html
Created February 14, 2024 05:20
web libraries
<!DOCTYPE html>
<html>
<head>
<meta name="charset" content="utf-8"/>
<meta name="csrf-token" content={ CSRF(ctx) }/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/admin-lte@3.2/dist/css/adminlte.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/unpoly@3.7.3/unpoly.min.css"/>
@sawirricardo
sawirricardo / install_packages.sh
Last active August 17, 2024 03:13
go almost must use libraries
go get -u github.com/joho/godotenv;
go get -u github.com/a-h/templ;
go get -u github.com/manifoldco/promptui;
go get -u github.com/go-chi/chi/v5;
go get -u gopkg.in/gomail.v2;
go get -u github.com/amacneil/dbmate/v2/pkg/driver/postgres;
go get -u github.com/jackc/pgx/v5/pgxpool;
go get -u github.com/gorilla/sessions;
go get -u github.com/gorilla/csrf;
go get -u github.com/google/uuid;
@sawirricardo
sawirricardo / select_types_postgres.sql
Created January 20, 2024 08:31
Select types for postgresql
select
t.typname as name,
n.nspname as schema,
t.typtype as type,
t.typcategory as category,
(
(
t.typinput = 'array_in'::regproc
and t.typoutput = 'array_out'::regproc
)