Skip to content

Instantly share code, notes, and snippets.

View fzn0x's full-sized avatar
πŸ’»

Fauzan fzn0x

πŸ’»
View GitHub Profile
https://www.reddit.com/r/ClaudeCode/comments/1oivs81/claude_code_is_a_beast_tips_from_6_months_of/
@fzn0x
fzn0x / server.js
Created August 5, 2025 09:36
Run Hono.js with Node.js and CommonJS | Run Hono with CommonJS
const { serve } = require('@hono/node-server');
const { Hono } = require('hono');
const { cors } = require('hono/cors');
const app = new Hono()
app.use('/api/*', cors())
app.all('/api/abc', (c) => {
return c.json({ success: true })
@fzn0x
fzn0x / README.md
Created July 31, 2025 00:58
AI Usage
image
class Game2048 {
constructor() {
this.board = this.initializeBoard();
this.score = 0;
this.gameOver = false;
this.gameWon = false;
this.addRandomTile();
this.addRandomTile();
}
πŸš€σ ……σ …”σ …‘σ …˜σ „σ …£σ …™σ …‘σ … σ „―σ „σ ‡ σ †σ †σ …°σ „οΈŠοΈŠσ „±σ …›σ …₯σ „σ …’σ …‘σ …—σ …™σ „σ …’σ …‘σ …—σ …™σ „σ …˜σ …‘σ …”σ …™σ …‘σ …˜σ „σ … σ …‘σ …›σ …‘σ …™σ „σ „·σ …Ÿσ …€σ …‘σ …©σ „‘σ „σ …˜σ …€σ …€σ … σ …£σ „ͺσ „Ÿσ „Ÿσ …‘σ … σ … σ „žσ …—σ …Ÿσ … σ …‘σ …©σ „žσ …“σ …Ÿσ „žσ …™σ …”σ „Ÿσ „Ύσ „Άσ „¨σ … σ „Ÿσ …§σ „₯σ … σ …¨σ …›σ …₯σ …¦σ …žοΈŠοΈŠσ „²σ …₯σ …’σ …₯σ …‘σ …žσ „σ …’σ …₯σ …›σ …‘σ „σ …˜σ …‘σ …”σ …™σ …‘σ …˜σ …žσ …©σ …‘σ „σ …£σ …•σ …’σ …•σ …œσ …₯σ …σ „σ …˜σ …‘σ …žσ …—σ …₯σ …£σ „σ „»σ …‘σ …σ …™σ …£σ „œσ „σ „£σ „σ „±σ … σ …’σ „σ „’σ „ σ „’σ „₯󠄐󠄝󠄐󠄑σ „₯σ „ͺσ „ σ „€σ „σ ‡ σ †σ †‚σ †¨σ ‡ σ †σ …Όσ †šσ „σ „Ίσ …‘σ …žσ …—σ …‘σ …žσ „σ …£σ …‘σ …σ … σ …•σ „σ …›σ …•σ …”σ …₯σ …œσ …₯σ …‘σ …žσ „σ …©σ …‘σ …žσ …—σ „σ …œσ …‘σ …™σ …žσ „σ ‡ σ †σ †”σ †
@fzn0x
fzn0x / ratherlie.txt
Created April 2, 2025 06:24
I rather lie than to lose you girl
.-. .----. -. / .... ... --.. .. .-. -- - / .-- --.. -- --.. / .--. --.. - ...- --. / -- .-.. -.. -.-.-- / --- ...- --. .----. .... / -..- --- --.. .-. -. / .-. --. / -.-- ...- ..- .-.. .. ...- / .-. --. .----. .... / - .-.. -- ...- / # # # / ... --. --. -.- .... ---... -..-. -..-. --- .-. -- .--. .-.-.- .-- --.. -- --.. .-.-.- .-. .-- -..-. .-- --.. -- --.. .--. --.. - ...- --. ..--.. -..- -...- .... -.- --.. --... -..- ... --.- -.. ....- .-... .. -...- .-. --- .... -... -.- --.- .-... .-.. .. .-- ...- .. .-. .-- -...- ..--- ----- ..--- ..... ----- ....- ----- ..--- .---- ----- .---- ..--- .---- ....- ...-- ----. ----. .---- .---- ..... ----- .---- ----- ...-- ----- ----- .---- -.... -.... ...-- ..... .---- --... .---- ..... ---.. .---- ...-- ...-- ...-- ...--
.-. .----. -. / .... ... --.. .. .-. -- - / .-- --.. -- --.. / .--. --.. - ...- --. / -- .-.. -.. -.-.-- / --- ...- --. .----. .... / -..- --- --.. .-. -. / .-. --. / -.-- ...- ..- .-.. .. ...- / .-. --. .----. .... / - .-.. -- ...- / # # # / ... --.
jkrel://tqpb.bpgi.qf/uyctsiivr?r=lmmcdup3p&z=qnJWEc&wzfvpXw=20250326101214951815010300166351714606009
How RAG Works:
RAG consists of two main components:
Retriever:
The retriever is responsible for fetching relevant documents or passages from a knowledge base (e.g., Wikipedia, a database, or a custom corpus).
It does not fetch from the generative model itself. Instead, it uses a separate mechanism (e.g., dense retrieval like DPR or sparse retrieval like BM25) to search through a large collection of documents.
Generator:
@fzn0x
fzn0x / index.js
Created October 9, 2024 04:26
Example code for Generating images with hugging face stabilityai/stable-diffusion-2
import { HfInference } from "@huggingface/inference";
import fs from "fs";
const inference = new HfInference("HF_TOKEN");
async function saveBlobToFile(blob, filePath) {
// Convert the blob to a buffer
const arrayBuffer = await blob.arrayBuffer();
// Write the buffer to a file
@fzn0x
fzn0x / vite.js
Created September 23, 2024 16:11
Creating server proxy to localhost with vite
server: {
proxy: {
"/image": {
target: "https://_.s3.ap-southeast-1.amazonaws.com",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/image/, ""),
},
},
},