Skip to content

Instantly share code, notes, and snippets.

View hiepxanh's full-sized avatar

hiepxanh hiepxanh

View GitHub Profile
@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
@hiepxanh
hiepxanh / cloudSettings
Last active January 19, 2021 13:32
Sync Hiep MOON
{"lastUpload":"2021-01-19T13:31:01.238Z","extensionVersion":"v3.4.3"}