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 June 4, 2026 22:02
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; // ¯\\_(ツ)_/¯
@nanodude
nanodude / plumbing.md
Created February 16, 2024 04:07 — forked from beli-sk/plumbing.md
git plumbing cheat sheet

the plumbing commands

refs

  • update-ref

    • update a branch (or other reference) to point to a specific commit sha
  • symbolic-ref

    • update a reference (usually HEAD) to point to another reference (like a branch)
@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;
@coderbyheart
coderbyheart / excercises.md
Last active May 27, 2026 07:54
Chinook Database Excercises

Fragen Sie auf der Chinook Datenbank die folgenden Daten ab: (Download unter https://www.sqlitetutorial.net/sqlite-sample-database/)

  1. Welche Musikgenres sind in der Datenbank hinterlegt?
  2. Alle IDs, Namen und Geburtsdaten der Mitarbeiter alphabetisch nach Nachname, Vorname sortiert.
  3. Die Titel des Albums „Master Of Puppets“.
  4. Alle Kunden, die Ihre E-Mail-Adresse bei gmail.com haben
  5. Die ID, der vollständige Name und E-Mail-Adresse des Kunden mit den meisten Rechnungen
  6. Erweiterung: mit dem meisten Umsatz
@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)