Skip to content

Instantly share code, notes, and snippets.

View kostasx's full-sized avatar
💭
Uncaught ReferenceError

Kostas Minaidis kostasx

💭
Uncaught ReferenceError
View GitHub Profile
@razhangwei
razhangwei / LangGraph.md
Created February 10, 2025 03:16
LangGraph cheatsheet

This is an excellent LangGraph cheat sheet! It provides a comprehensive and practical overview of LangGraph's key features and usage. Here's a slightly refined version with added clarity and formatting for better readability:


LangGraph Cheat Sheet

1. Import Necessary Modules

from typing import TypedDict, Dict, Any, Callable
from langchain_core.runnables import Runnable
@razhangwei
razhangwei / How to read TS package.md
Last active August 6, 2025 12:57
TypeScript Cheatsheet
File / Folder Purpose
src/ Source TypeScript code (.ts, .tsx)
dist/ or lib/ Compiled output (.js, .d.ts)
index.ts, main.ts Package entry point or main logic file
package.json Project metadata, scripts, dependencies
package-lock.json Dependency version lock file (auto-generated by npm)
tsconfig.json TypeScript compiler configuration (target, paths, output, etc.)
vitest.config.ts Vitest test runner configuration
test-setup.ts Global
@kostasx
kostasx / Ollama.CLI.tricks.md
Created August 24, 2024 21:50
Ollama Command Line Tricks (YouTube: https://youtu.be/7mw792o1sSg)
  • Input from stdin

    • ollama run llama3.1 "prompt"
  • Multiline input

    • Using """
  • Input from file

    • Using the pipe | operator:
      • cat fox.txt | ollama run llama3.1 "Please translate the provided text to German"
  • Using the redirection operator < :

@kostasx
kostasx / crypto-aes-gcm.js
Created July 11, 2024 21:59 — forked from chrisveness/crypto-aes-gcm.js
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@OrionReed
OrionReed / dom3d.js
Last active August 31, 2025 17:00
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@QuocCao-dev
QuocCao-dev / 1.Basic-Type.txt
Last active May 6, 2024 16:40
Typescript Exercises
/* *-*-*-*-*-*-*-*-*-*-* Challenge 1 ------------------
Create a variable with the type number and assign it an arbitrary value
*/
// ----------------------------------------------------
// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
// ----------------------------------------------------
/* *-*-*-*-*-*-*-*-*-*-* Challenge 2 ------------------
Create a variable with the type string and use the addition operator to put two arbitrary words together
*/
@KTibow
KTibow / Monaco.svelte
Created November 6, 2022 20:14
Monaco editor in svelte
<script>
import { onMount } from "svelte";
import editorWorker from "monaco-editor/esm/vs/editor/editor.worker?worker";
import jsonWorker from "monaco-editor/esm/vs/language/json/json.worker?worker";
import cssWorker from "monaco-editor/esm/vs/language/css/css.worker?worker";
import htmlWorker from "monaco-editor/esm/vs/language/html/html.worker?worker";
import tsWorker from "monaco-editor/esm/vs/language/typescript/ts.worker?worker";
let subscriptions = [];
export let content;
@getify
getify / 1.md
Last active September 2, 2025 12:49
In defense of using blocks to create localized scope for variables... (part 1 of 2)
module.exports = {
content: ["./src/**/*.{html,js, jsx}"],
theme: {
extend: {},
},
plugins: [],
}
@olygood
olygood / .eslinterc.json
Created January 6, 2022 12:14
nextjs eslint disable rules
{
"extends": "next",
"rules": {
"react/no-unescaped-entities": "off",
"@next/next/no-page-custom-font": "off"
}
}