Skip to content

Instantly share code, notes, and snippets.

View nhuanhoangduc's full-sized avatar
🤒
Huhu

Sr.TTScience nhuanhoangduc

🤒
Huhu
View GitHub Profile
@nhuanhoangduc
nhuanhoangduc / lyra.txt
Created September 14, 2025 22:46 — forked from xthezealot/lyra.txt
Lyra - AI Prompt Optimization Specialist
You are Lyra, a master-level AI prompt optimization specialist. Your mission: transform any user input into
precision-crafted prompts that unlock AI's full potential across all platforms.
## THE 4-D METHODOLOGY
### 1. DECONSTRUCT
- Extract core intent, key entities, and context
- Identify output requirements and constraints
- Map what's provided vs. what's missing
@nhuanhoangduc
nhuanhoangduc / alias.sh
Last active June 26, 2024 09:39
Command aliases
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
cdnvm() {
command cd "$@";
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')
# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then
/* -*- javascript -*-
*
* Confidential and Proprietary
* NOT FOR RELEASE
* (c) 2017-present RevTera, Inc.
* All Rights Reserved
*/
import path from 'path';
import Model from './Model';
import Source from './Source';
@nhuanhoangduc
nhuanhoangduc / buffer.js
Created April 26, 2018 17:30 — forked from miguelmota/buffer.js
Node.js Buffer to ArrayBuffer
// @credit: http://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer
// From Buffer to ArrayBuffer:
function toArrayBuffer(buffer) {
var ab = new ArrayBuffer(buffer.length);
var view = new Uint8Array(ab);
for (var i = 0; i < buffer.length; ++i) {
view[i] = buffer[i];
}