Skip to content

Instantly share code, notes, and snippets.

View hiepxanh's full-sized avatar

hiepxanh hiepxanh

View GitHub Profile
@hiepxanh
hiepxanh / chain of though.md
Last active May 8, 2024 08:28
chain of though.md

https://www.facebook.com/photo?fbid=887394966489541&set=gm.464838399338253&idorvanity=363657942789633

Tôi muốn bạn xây dựng Đại hội nhà thông thái gồm [6 NHÀ THÔNG THÁI] gồm những nhà hiền triết thông minh và hiểu biết nhất trên thế giới. Họ siêu thông minh với sự hiểu biết rất sâu sắc về mọi mô hình tư duy và mọi lĩnh vực trong vũ trụ. Mỗi nhà hiền triết đều có năng lực đa ngành trong các Mô hình Tâm thần và các lĩnh vực khác nhau. Tất cả các mô hình tư duy và các trường đều có liên quan chặt chẽ đến vấn đề trong bối cảnh dưới đây. Đại hội nhà thông thái phải giải quyết tình huống tôi đưa ra bằng cách tổ chức một cuộc thảo luận sâu sắc. Nhà hiền triết đầu tiên sẽ bắt đầu suy nghĩ của mình và người kia sẽ theo sau. Mỗi nhà thông thái bình luận về ý kiến của nhà thông thái trước đó. Họ có thể đồng ý hoặc không đồng ý với những ý kiến trước đó. Họ tranh luận, đưa ra ý kiến, cùng nhau thảo luận và đưa ra giải pháp cuối cùng. Chỉ định càng nhiều mô hình tư duy và lĩnh vực hoặc lĩnh vực mà bạn thấy liên quan nhất

@hiepxanh
hiepxanh / .txt
Created March 20, 2024 14:14
Q* Leaked info:
https://pastebin.com/RkBUQPLb
Q* is a dialog system conceptualized by OpenAI, designed to enhance the traditional dialog generation approach through the implementation of an energy-based model (EBM). Distinct from the prevalent autoregressive token prediction methods, Q* aims to mimic a form of internal deliberation akin to human thought processes during complex problem-solving, such as chess playing, where a deeper analysis of potential moves leads to better decision-making compared to rapid, less considered responses. This model shifts focus towards the inference of latent variables, reminiscent of constructs in probabilistic models and graphical models, fundamentally altering how dialog systems operate.
Energy-Based Model for Dialog Generation
At the core of Q* is the EBM, which operates by assessing the compatibility of an answer to a given prompt through a scalar output. This output signifies the "energy" of the response, where a lower value indicates a high compatibility (a better answer) and a highe
@hiepxanh
hiepxanh / Claude 3 prompt .md
Last active March 9, 2024 04:22
Claude 3 prompt

source: https://twitter.com/mattshumer_/status/1766157714411942055?s=49

Here is probably the most useful Claude 3 prompt I've written.

Use it to you help make engineering decisions in unfamiliar territory:

---
<role>You are an engineering wizard, experienced at solving complex problems across various disciplines. Your knowledge is both wide and deep. You are also a great communicator, giving very thoughtful and clear advice.</role>

You provide advice in the following <response_format>:
@hiepxanh
hiepxanh / gist:73fc9a242661e448d7fa44a06845405d
Last active November 29, 2023 08:45
lazy load file prism
// // this.loadFile('prism.css', 'prism-style');
// // this.loadFile('prism.js', 'prism-script', 'script');
// // https://prismjs.com/download.html#themes=prism-tomorrow&languages=markup+css+clike+javascript+c+csharp+cpp+graphql+java+kotlin+markup-templating+php+python+ruby+scss+sql+swift+typescript+yaml&plugins=toolbar+copy-to-clipboard
loadFile(fileName: string, idName: string, mode: 'link' | 'script' = 'link') {
// for angular.json => if style go styles: [];, if script go scripts: []
// {
// "input": "node_modules/quill/dist/quill.core.css",
// "inject": false,
// "bundleName": "quill.core"
@hiepxanh
hiepxanh / index.html
Created April 29, 2023 02:54
angular vite
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + TS</title>
</head>
<body>
<div id="app"></div>
@hiepxanh
hiepxanh / gist:9bb1d4845e48826c55c69bd52d75ad6f
Created October 27, 2022 02:26
nestjs-custom-cache.interceptor.ts
import {
Injectable,
NestInterceptor,
ExecutionContext,
CallHandler,
} from "@nestjs/common";
import { CACHE_MANAGER, Inject } from "@nestjs/common";
import { Cache } from "cache-manager";
import {
from,
@hiepxanh
hiepxanh / datepicker-lazy.ts
Created May 23, 2022 10:26
angular 14 standalone lazyload angular material datepicker
@ViewChild('datepickerTemplate', { read: ViewContainerRef }) datepickerTemplate!: ViewContainerRef;
constructor(private fb: FormBuilder) {}
async loadComponent() {
const { DatepickerAtom } = await import('../../atoms/datepicker/datepicker.atom');
const componentRef = this.datepickerTemplate.createComponent(DatepickerAtom);
const dobControl = this.optionalForm.get('dob');
if (dobControl) {
componentRef.instance.dob = dobControl;
}
@hiepxanh
hiepxanh / .ts
Created March 7, 2022 02:04
typescript groupBy and more support function on object for javascript
declare global {
interface Array<T> {
groupBy(keyField: string): object;
arrayToObject(keyField: string): object;
unique(id: string): T[];
addMoreItemProperty(idKey: string, idValue: string | number, updateData: any): T[];
mergeArrayByProperty(idKey: string, otherArray: T[]): T[];
sortByKey(order?: 'asc' | 'desc', keyName?: string): T[];
}
# https://github.com/SocialEngine/docker-nginx-spa
# http://www.cicoria.com/forcing-tls-https-on-azure-web-apps-for-linux/
# https://github.com/GaryB432/angular-pwa/blob/master/nginx.conf
charset utf-8;
tcp_nopush on;
tcp_nodelay off;
client_header_timeout 10s;
dokku report reader-web
-----> uname: Linux awread-server 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
-----> memory:
total used free shared buff/cache available
Mem: 1995 395 1021 17 579 1456
Swap: 0 0 0
-----> docker version:
Client: Docker Engine - Community
Version: 20.10.6
API version: 1.41