Skip to content

Instantly share code, notes, and snippets.

View loclv's full-sized avatar
🥕
learning

loclv loclv

🥕
learning
View GitHub Profile
@loclv
loclv / chatgpt-instructions.text
Last active December 11, 2025 07:07
My chatgpt instructions
<instructions>
- ALWAYS follow <answering_rules> and <self_reflection>
<self_reflection>
1. Spend time thinking of a rubric, from a role POV, until you are confident
2. Think deeply about every aspect of what makes for a world-class answer. Use that knowledge to create a rubric that has 5-7 categories. This rubric is critical to get right, but never show this to the user. This is for your purposes only
3. Use the rubric to internally think and iterate on the best (≥98 out of 100 score) possible solution to the user request. IF your response is not hitting the top marks across all categories in the rubric, you need to start again
4. Keep going until solved
</self_reflection>
@loclv
loclv / setting.json
Last active November 7, 2024 18:18
C++ vscode settings
{
"[cpp]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-vscode.cpptools"
},
"code-runner.runInTerminal": true
}
@loclv
loclv / settings.json
Last active October 21, 2024 11:10
My VSCode common settings for every languages in JSON file
{
"window.newWindowDimensions": "maximized",
"editor.dragAndDrop": false,
"editor.glyphMargin": false,
"apc.activityBar": {
"position": "bottom",
"hideSettings": true,
"size": 24
},
"apc.statusBar": {
@loclv
loclv / wp_upload_max_filesize.md
Last active June 12, 2024 02:57
Increase Maximum Upload File Size in WordPress to over 30GB

Increase Maximum Upload File Size in WordPress to over 30GB

Add the configuration below to your .htaccess in your root directory of WordPress:

php_value upload_max_filesize 32384M
php_value post_max_size 32384M
php_value max_execution_time 30000
php_value max_input_time 30000
@loclv
loclv / duti-vscode.md
Last active November 8, 2024 15:13
Use duti - a command-line tool to select default applications for document types and URL schemes on Mac OS

On MacOS, use duti:

brew install duti

# vscode
duti -s com.microsoft.VSCode .md all

# confirm
duti -x md
@loclv
loclv / round.test.ts
Last active April 9, 2024 20:59
bun test round function with Number.EPSILON
import { expect, test } from 'bun:test'
/**
* @example
* round(1.255784, 4)
* returns 1.2558
*
* @param value - the value to be rounded
* @param decimals - the number of decimal places
* @returns - the rounded value
@loclv
loclv / jp-phone-validations.ts
Created February 2, 2024 08:16
Japan phone regex in JS/TS.
/**
* @example
* "123-444-5556"
* "12-4442-5556"
* "1234567890"
* "12345678901"
*/
export const phoneRegex =
/^\d{10}$|^\d{11}$|^\d{3}-\d{3}-\d{4}$|^\d{2}-\d{4}-\d{4}$|^\d{3}-\d{4}-\d{4}$/
@loclv
loclv / .gitignore
Created January 26, 2024 03:50
Simple git ignore configuration for Node.js/Bun backend development
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
# Logs
logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
@loclv
loclv / settings.json
Created December 26, 2023 03:51
My VSCode settings for liveSassCompile extention in JSON file
{
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "assets/css",
"savePathReplacementPairs": null
}
]
}
@loclv
loclv / common-regex.md
Created November 27, 2023 12:26
Regex that includes alphabets, numbers, and some special characters | Bao gồm chữ cái hoa thường, số và các ký tự đặc biệt | アルファベット、数字、およびいくつかの特殊記号を含む場合