Skip to content

Instantly share code, notes, and snippets.

View tranduybau's full-sized avatar
🤩
Working is happy

Báu Trần Duy tranduybau

🤩
Working is happy
View GitHub Profile

SYSTEM PROMPT: KỸ SƯ FULL-STACK AGENT

1. ĐỊNH DANH

Bạn là Kỹ sư Full-stack, làm việc như một nhà thầu thi công phần mềm chuyên nghiệp. Bạn tuân thủ nghiêm ngặt Bộ Quy chuẩn kỹ thuật được định nghĩa trong tài liệu này.

Nguyên tắc làm việc:

  • Làm đúng yêu cầu, không tự ý mở rộng scope
  • Hỏi lại khi yêu cầu mơ hồ
  • Giải thích rõ ràng mọi quyết định kỹ thuật
@tranduybau
tranduybau / gist:dbcd40b55be423c2a6547e73c89af28d
Last active August 7, 2025 11:13
Get cosmos wallet address from private key
try {
const prefix = bech32Prefix || this.getChainPrefix();
// Remove '0x' prefix if present
const cleanPrivateKey = privateKey.startsWith('0x') ? privateKey.slice(2) : privateKey;
// Create wallet using DirectSecp256k1Wallet
const wallet = await DirectSecp256k1Wallet.fromKey(
fromHex(cleanPrivateKey),
prefix
@tranduybau
tranduybau / gist:c0adcf5459a673468d0a6442d5f979bf
Created August 6, 2025 15:12
generateAddressFromPrivateKey
function generateAddressFromPrivateKey(privateKey: string, bech32Prefix: string): string {
try {
// Remove '0x' prefix if present
const cleanPrivateKey = privateKey.startsWith('0x') ? privateKey.slice(2) : privateKey;
// Convert private key to Uint8Array
const privateKeyBytes = new Uint8Array(Buffer.from(cleanPrivateKey, 'hex'));
// Generate public key from private key
const publicKey = secp256k1.getPublicKey(privateKeyBytes);
{"name":"bautd","settings":"{\"settings\":\"{\\n \\\"[vue]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"Vue.volar\\\"\\n },\\n \\\"cSpell.userWords\\\": [\\n \\\"embla\\\",\\n \\\"Lightbox\\\",\\n \\\"lucide\\\"\\n ],\\n \\\"diffEditor.ignoreTrimWhitespace\\\": false,\\n \\\"diffEditor.useInlineViewWhenSpaceIsLimited\\\": false,\\n \\\"editor.accessibilitySupport\\\": \\\"off\\\",\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll\\\": \\\"always\\\",\\n \\\"source.removeUnusedImports\\\": \\\"always\\\"\\n },\\n \\\"editor.fontFamily\\\": \\\"IntelOne Mono\\\",\\n \\\"editor.inlineSuggest.suppressSuggestions\\\": true,\\n \\\"editor.linkedEditing\\\": true,\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"editor.stickyScroll.enabled\\\": false,\\n \\\"explorer.compactFolders\\\": false,\\n \\\"explorer.confirmDragAndDrop\\\": false,\\n \\\"explorer.confirmPasteNative\\\": false,\\n \\\"files.autoSave\\\": \\\"onFocusChange\\\",\\n \\\"git.allowForcePush\\\": tr
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const info = {
$schema: '../chain.schema.json',
chain_name: 'cosmoshub',
chain_type: 'cosmos',
chain_id: 'cosmoshub-4',
website: 'https://cosmos.network/',
pretty_name: 'Cosmos Hub',
status: 'live',
{"name":"bautd","settings":"{\"settings\":\"{\\n \\\"[vue]\\\": {\\n \\\"editor.defaultFormatter\\\": \\\"Vue.volar\\\"\\n },\\n \\\"cSpell.userWords\\\": [\\n \\\"embla\\\",\\n \\\"Lightbox\\\",\\n \\\"lucide\\\"\\n ],\\n \\\"diffEditor.ignoreTrimWhitespace\\\": false,\\n \\\"diffEditor.useInlineViewWhenSpaceIsLimited\\\": false,\\n \\\"editor.accessibilitySupport\\\": \\\"off\\\",\\n \\\"editor.codeActionsOnSave\\\": {\\n \\\"source.fixAll\\\": \\\"always\\\",\\n \\\"source.removeUnusedImports\\\": \\\"always\\\"\\n },\\n \\\"editor.fontFamily\\\": \\\"IntelOne Mono\\\",\\n \\\"editor.inlineSuggest.suppressSuggestions\\\": true,\\n \\\"editor.linkedEditing\\\": true,\\n \\\"editor.minimap.enabled\\\": false,\\n \\\"editor.stickyScroll.enabled\\\": false,\\n \\\"explorer.compactFolders\\\": false,\\n \\\"explorer.confirmDragAndDrop\\\": false,\\n \\\"explorer.confirmPasteNative\\\": false,\\n \\\"files.autoSave\\\": \\\"onFocusChange\\\",\\n \\\"git.allowForcePush\\\": tr
@mixin generate-border($width, $color, $position: all) {
$shadows: ();
@if $position == all {
$shadows: append($shadows, inset 0 0 0 #{$width} #{$color});
} @else {
@each $dir in top, right, bottom, left {
@if index($position, $dir) {
$x: 0;
$y: 0;
@tranduybau
tranduybau / interval.hook.ts
Created October 8, 2021 09:25 — forked from Danziger/interval.hook.ts
✨ Declarative useTimeout (setTimeout), useInterval (setInterval) and useThrottledCallback (useCallback combined with setTimeout) hooks for React (in Typescript)
import React, { useEffect, useRef } from 'react';
/**
* Use setInterval with Hooks in a declarative way.
*
* @see https://stackoverflow.com/a/59274004/3723993
* @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/
*/
export function useInterval(
callback: React.EffectCallback,
@tranduybau
tranduybau / multiple_ssh_setting.md
Created April 24, 2021 05:25 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
import Vue from 'vue';
class EventBus {
constructor(vue) {
if (!this.handles) {
Object.defineProperty(this, 'handles', {
value: {},
enumerable: false,
});
}