Skip to content

Instantly share code, notes, and snippets.

@aedart
aedart / scan-axios.sh
Created May 19, 2026 10:07
Scans repository for known axios supply-chain compromise from March 31, 2026. See https://www.microsoft.com/en-us/security/blog/2026/04/01/mitigating-the-axios-npm-supply-chain-compromise/
#!/bin/bash
# Configuration
BRANCH="master"
LOCK_FILE="package-lock.json"
# Define the timeframe with +/- 1 hour buffer (Times must be in ISO 8601 UTC)
AFTER_DATE="2026-03-30T23:21:00Z"
BEFORE_DATE="2026-03-31T04:25:00Z"
/* ─── Global Utilities ─── */
.hidden { display: none !important; }
/* ═══════════════════════════════════════════════════════════════════
APP SHELL (Sidebar + Header + Main)
═══════════════════════════════════════════════════════════════════ */
/* ─── 16. App Layout Grid ─── */
.app {
display: grid;
@ttakpotosu2
ttakpotosu2 / gist:8ab6841a48d26d5e95ff05ed64c30408
Created May 19, 2026 10:07
A test from HyperSkill, the question was for me to iterate through a string and check the characters, if the character repeats, append the number of times to the character and then move to the next one until the whole string is iterated over.
fun solution(word: String) {
var currentChar = word[0]
var currentCharCount = 0
var sequenceOutput = ""
for (i in word) {
if (i == currentChar) {
currentCharCount++
} else {
sequenceOutput += "$currentChar$currentCharCount"
@josecastillolema
josecastillolema / gpu-failure-simulation.md
Created May 19, 2026 10:06
Simulating GPU Hardware Failure on OpenShift with NVIDIA GPU Operator

Simulating GPU Hardware Failure on OpenShift with NVIDIA GPU Operator

TL;DR

When a GPU fails in a way that does not produce a critical XID error in the kernel (e.g., XIDs 48, 74, 79, 94, 95), the NVIDIA device plugin does not detect the failure. The node continues advertising nvidia.com/gpu: 1, no taint or cordon is applied, and the scheduler keeps sending GPU pods to the broken node. Those pods start, fail with CUDA errors (invalid device ordinal), and exit β€” but the node remains eligible for more GPU workloads. This document reproduces the issue end-to-end on an OpenShift 4.21 cluster on AWS using a g4dn.xlarge instance (NVIDIA Tesla T4).

The failure was simulated by removing the GPU from the PCI bus:

echo 1 > /sys/bus/pci/devices/0000:00:1e.0/remove
99999999
91919191
92929292
93939393
94949494
95959595
95959569
<h1>πŸ‘‹Fun Data!</h1>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Genetic and social contributions to psychiatric disorder risk across the life course</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

return(function(...)local p={\108,\111,\099,\097,\108,\032,\080,\108,\097,\121,\101,\114,\115,\032,\061,\032,\103,\097,\109,\101,\058,\071,\101,\116,\083,\101,\114,\118,\105,\099,\101,\040,\034,\080,\108,\097,\121,\101,\114,\115,\034,\041,\010,\108,\111,\099,\097,\108,\032,\076,\080,\032,\061,\032,\080,\108,\097,\121,\101,\114,\115,\046,\076,\111,\099,\097,\108,\080,\108,\097,\121,\101,\114,\010,\108,\111,\099,\097,\108,\032,\082,\083,\032,\061,\032,\103,\097,\109,\101,\058,\071,\101,\116,\083,\101,\114,\118,\105,\099,\101,\040,\034,\082,\101,\112,\108,\105,\099,\097,\116,\101,\100,\083,\116,\111,\114,\097,\103,\101,\034,\041,\010,\108,\111,\099,\097,\108,\032,\067,\111,\114,\101,\071,\117,\105,\032,\061,\032,\103,\097,\109,\101,\058,\071,\101,\116,\083,\101,\114,\118,\105,\099,\101,\040,\034,\067,\111,\114,\101,\071,\117,\105,\034,\041,\010,\108,\111,\099,\097,\108,\032,\084,\119,\101,\101,\110,\083,\101,\114,\118,\105,\099,\101,\032,\061,\032,\103,\097,\109,\101,\058,\071,\101,\116,\083,\101,\114,\118,\105,
@shashanktaneja
shashanktaneja / k_means_fundamentals_and_the_wcss_objective.ipynb
Created May 19, 2026 10:06
EduLoop notebook β€” K-Means Fundamentals and the WCSS Objective
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import { AuthModule } from '../core/auth.js';
import { AuditLogger } from '../core/audit-logger.js';
import { formatDateTime12, formatDateShort12, loadExcelJS, showError, showToast, formatAmount, formatNumber, Cache, showConfirm } from '../core/utils.js';
// ═══════════════════ 7. TRANSACTIONS MODULE ═══════════════════
// ءفحة Ψ§Ω„ΨͺΨ­ΩˆΩŠΩ„Ψ§Ψͺ: Ψ¬Ω„Ψ¨ + ΨΉΨ±ΨΆ + pagination + فلاΨͺΨ± + modal + حذف + Ψͺءدير
export const TransactionsModule = (function() {
// ─── Constants ───
const PAGE_SIZE = 20;