Skip to content

Instantly share code, notes, and snippets.

View TheGU's full-sized avatar
🎯
Focusing

Pattapong J. TheGU

🎯
Focusing
  • 021
  • Bangkok, Thailand
  • X @thegu
View GitHub Profile
@TheGU
TheGU / copilot-instructions.md
Last active July 7, 2025 09:17
Inspire by https://github.com/iannuttall/claude-sessions to have a session note but for vscode + copilot by instruct in .github/copilot-instructions.md file.

Use session files to track development progress and goals. These files are located in docs/sessions/ and should be created for each new development session. Always check current time and date with date command before write date related information in session files. Use the following format for session files:

start: Start a new development session by creating a session file in docs/sessions/ with the format YYYY-MM-DD-HHMM-{NAME}.md. The session file should begin with:

  1. Session name and timestamp as the title. name should be descriptive of the session's focus.
  2. Session overview section with start time
  3. Goals section (ask user for goals if not clear)
  4. Empty progress section ready for updates
@TheGU
TheGU / gen_stereoscopic_hidden_text.ts
Created February 10, 2025 10:08
Create a hidden text with stereoscopic effect
var arr = "The old building sighed, each creak a testament to time. Dust motes danced in a lone sunbeam. A layer of grime settled under a neglected wooden bench. The sharp jangle of a telephone abruptly shattered the pervasive quiet. Near this lonely, forgotten corner, the cold steel doors of the elevator silently waited.".split(' ');
var secret = "under telephone Near elevator".split(' ');
var i = -1;
var MAX_WIDTH = 30;
var lines = [[]];
var _l = 0;
var result = '';
while (i++ < arr.length - 1) {
@TheGU
TheGU / Satoshi_Nakamoto.asc
Created January 23, 2025 06:18 — forked from carlos8f/Satoshi_Nakamoto.asc
Satoshi Nakamoto's PGP key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.7 (MingW32)
mQGiBEkJ+qcRBADKDTcZlYDRtP1Q7/ShuzBJzUh9hoVVowogf2W07U6G9BqKW24r
piOxYmErjMFfvNtozNk+33cd/sq3gi05O1IMmZzg2rbF4ne5t3iplXnNuzNh+j+6
VxxA16GPhBRprvnng8r9GYALLUpo9Xk17KE429YYKFgVvtTPtEGUlpO1EwCg7FmW
dBbRp4mn5GfxQNT1hzp9WgkD/3pZ0cB5m4enzfylOHXmRfJKBMF02ZDnsY1GqeHv
/LjkhCusTp2qz4thLycYOFKGmAddpVnMsE/TYZLgpsxjrJsrEPNSdoXk3IgEStow
mXjTfr9xNOrB20Qk0ZOO1mipOWMgse4PmIu02X24OapWtyhdHsX3oBLcwDdke8aE
gAh8A/sHlK7fL1Bi8rFzx6hb+2yIlD/fazMBVZUe0r2uo7ldqEz5+GeEiBFignd5
@TheGU
TheGU / flatten_file.ps1
Created January 15, 2025 02:19
Powershell command to flatten file of specific ext. from sub folder
$targetDir = Convert-Path '.'
$targetExt = '*.ttf'
Get-ChildItem -LiteralPath $targetDir -Directory | Get-ChildItem -Recurse -File -Filter $targetExt | Move-Item -Destination $targetDir -Whatif
@TheGU
TheGU / dark_minimal.omp.json
Last active March 28, 2024 01:45
Oh-My-Posh theme focus on detail for dev and black background
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"palette": {
"red": "#ff5370",
"magenta": "#FE5672",
"green": "#7fdbca",
"blue": "#82AAFF",
"lightBlue": "#8ADDFF",
"yellow": "#FFCA6A",
@TheGU
TheGU / SetupWin11.ps1
Last active January 20, 2025 10:28
Auto setup new win11 pc for development.
# =============
# Run terminal as admin, then run 'powershell.exe -ExecutionPolicy Unrestricted'
# to start powershell session in unrestricted mode
# https://learn.microsoft.com/th-th/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
# get all input parameter
$computerName = Read-Host 'Change Computer Name from [' $env:COMPUTERNAME '] to (blank to skip) '
$monitorTimeout = Read-Host 'Set monitor timeout to __ second (blank to skip) '
@TheGU
TheGU / th-address.json
Created November 20, 2023 13:47 — forked from mennwebs/th-address.json
Thai Address from Postal Code - JSON
This file has been truncated, but you can view the full file.
[
{
"zipCode": "10100",
"subDistrictList": [
{
"subDistrictId": "100801",
"districtId": "1008",
"provinceId": "10",
"subDistrictName": "ป้อมปราบ"
},
@TheGU
TheGU / setup_windows_powerline.md
Last active March 26, 2022 10:09
Setup Oh-My-Posh powerline on Windows 10
@TheGU
TheGU / s3_upload.py
Created February 19, 2021 00:36
Upload to AWS S3 then recheck content with md5 hash
import os
import boto3
import botocore
import hashlib
def md5sum(filepath):
hash = hashlib.md5()
with open(filepath, "rb") as f:
for chunk in iter(lambda: f.read(128 * hash.block_size), b""):
@TheGU
TheGU / upgrade_openssh_openssl.sh
Created February 1, 2019 02:21
Upgrade openssh and openssl on rhel6
#!/bin/bash
# Prepare folder
mkdir -p /app/ssh_upgrade && cd /app/ssh_upgrade
# Get openssl source file : openssl-1.0.2q.tar.gz
wget https://www.openssl.org/source/openssl-1.0.2q.tar.gz
# Get openssh source file : openssh-7.7p1.tar.gz
wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz