Skip to content

Instantly share code, notes, and snippets.

View nsdevaraj's full-sized avatar
🎯
Focusing

N.S.Devaraj nsdevaraj

🎯
Focusing
View GitHub Profile
@nsdevaraj
nsdevaraj / Index.html
Last active March 14, 2026 13:13
Chess puzzles
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Offline Chess Puzzles</title>
<!-- Tailwind CDN (play/browser v4 or classic v3, pick one) -->
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<!-- or classic:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Morse Code Tutor + Trainer</title>
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Morse Code Translator</title>
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<style>
import { useState, useEffect, useRef, useCallback } from “react”;
const MORSE = {
A:”.-”,B:”-…”,C:”-.-.”,D:”-..”,E:”.”,F:”..-.”,G:”–.”,H:”….”,
I:”..”,J:”.—”,K:”-.-”,L:”.-..”,M:”–”,N:”-.”,O:”—”,P:”.–.”,
Q:”–.-”,R:”.-.”,S:”…”,T:”-”,U:”..-”,V:”…-”,W:”.–”,X:”-..-”,
Y:”-.–”,Z:”–..”
};
const N_ = {
@nsdevaraj
nsdevaraj / heap.py
Last active March 4, 2026 08:16
analyse chrome memory heap
"""
Fast V8 heap snapshot analyser
Focuses on: type distribution, detached nodes, large objects, closure/object names
Skips expensive full-graph retained-size computation.
"""
import json, collections, sys
SNAPSHOT_PATH = '/sessions/practical-relaxed-franklin/mnt/uploads/Heap-20260226T131952.heapsnapshot'
@nsdevaraj
nsdevaraj / tmux.conf
Created February 25, 2026 01:12
nano ~/.tmux.conf && tmux source-file ~/.tmux.conf
##### Basics #####
# Use tmux-256color and enable RGB
set -g default-terminal "tmux-256color"
set-option -sa terminal-features ",xterm*:RGB"
# History & timings
set -g history-limit 20000
set -sg escape-time 0
set -g repeat-time 300
// microgpt.js — tiny dependency-free GPT in JavaScript
// ~ port of karpathy/microgpt.py https://gist.github.com/karpathy/8627fe009c40f57531cb18360106ce95
const fs = require("fs");
const https = require("https");
// -------------------- Helpers --------------------
function download(url, dest) {
return new Promise((resolve, reject) => {
@nsdevaraj
nsdevaraj / final cut.sh
Last active January 21, 2026 09:36
extend trial
mv -v ~/Library/Containers/com.apple.FinalCutTrial/Data/Library/Application\ Support/.ffuserdata ~/.Trash
mv -v ~/Library/Application\ Support/.lpxuserdata ~/.Trash
#EXTM3U
#EXTINF:-1 tvg-id="3ABNKids.us@SD" tvg-logo="https://i.imgur.com/z3npqO1.png" group-title="Animation;Kids;Religious",3ABN Kids Network
https://3abn.bozztv.com/3abn2/Kids_live/smil:Kids_live.smil/playlist.m3u8
#EXTINF:-1 tvg-id="ADNTVPlus.fr@SD" tvg-logo="https://i.imgur.com/HQZQyWt.png" group-title="Animation",ADN TV+
https://d3b73b34o7cvkq.cloudfront.net/v1/master/3722c60a815c199d9c0ef36c5b73da68a62b09d1/cc-gz2sgqzp076kf/adn.m3u8
#EXTINF:-1 tvg-id="AnimationShowChannel.cn@SD" tvg-logo="https://i.imgur.com/Ul1pjUN.png" group-title="Animation;Kids",Animation Show Channel
http://180.213.174.225:9901/tsfile/live/1034_1.m3u8?authid=0&key=txiptv&playlive=1
#EXTINF:-1 tvg-id="AnimaxAsia.sg@India" tvg-logo="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Animax.png/512px-Animax.png" group-title="Animation",Animax Asia India (1080p) [Geo-blocked]
https://amg02159-kcglobal-amg02159c1-samsung-in-521.playouts.now.amagi.tv/playlist/amg02159-kcglobal-animax-samsungin/playlist.m3u8
#EXTINF:-1 tvg-id="Anim
'''mermaid
graph TD
subgraph "Pen Housing"
subgraph "Power Subsystem"
A[Rechargeable Battery<br/>(e.g., Li-Po)] --> B[Power Management IC<br/>(Regulator & Charging Circuit)];
B --> |VCC| C;
B --> |VCC| G;
B --> |VCC| H;
end