Skip to content

Instantly share code, notes, and snippets.

View nsdevaraj's full-sized avatar
🎯
Focusing

N.S.Devaraj nsdevaraj

🎯
Focusing
View GitHub Profile
<html lang="en"><head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vector Studio - SVG Editor &amp; Tracer</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Alpine.js -->
<script defer="" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
<!-- Google Fonts & Icons -->
@nsdevaraj
nsdevaraj / convert.ps1
Last active November 19, 2025 06:17
convert pbix
# PBIX Converter Utility
# Converts PBIX files by modifying visual types and removing SecurityBindings
param(
[Parameter(Mandatory=$true, Position=0)]
[string]$InputFile,
[Parameter(Mandatory=$false, Position=1)]
[string]$OutputFile
)
@nsdevaraj
nsdevaraj / Sidebar.tsx
Created October 23, 2025 15:49
react activity
import { useState } from 'react';
import { unstable_Activity as Activity } from 'react';
function Sidebar() {
const [scrollPosition, setScrollPosition] = useState(0);
const [inputValue, setInputValue] = useState('');
// This effect would pause when hidden
useEffect(() => {
const timer = setInterval(() => {
@nsdevaraj
nsdevaraj / Output
Last active October 23, 2025 02:22
import { topNPareto, topNPercentile } from './statsUtil.js';
const salesData = [
{ product: 'A', revenue: 100 },
{ product: 'B', revenue: 50 },
{ product: 'C', revenue: 30 },
{ product: 'D', revenue: 20 }
];
// Top 80% Pareto (A + B = 150/200 = 75%, but we include until >=80%; here A+B=75%, so add C for 90%)
@nsdevaraj
nsdevaraj / open.sh
Created October 9, 2025 05:55
open all urls
while read -r url; do open "$url"; done < /tmp/urls.txt
@nsdevaraj
nsdevaraj / App.jsx
Last active October 9, 2025 03:34
detect face
import React, { useRef, useEffect, useState } from 'react';
import * as faceapi from '@vladmandic/face-api';
function App() {
const videoRef = useRef(null);
const canvasRef = useRef(null);
const [photo, setPhoto] = useState(null);
const [validation, setValidation] = useState({});
const [modelsLoaded, setModelsLoaded] = useState(false);
const [modelsLoading, setModelsLoading] = useState(true);
@nsdevaraj
nsdevaraj / background.js
Created August 11, 2025 09:12
GitHub pr counter
// background.js (robust counting + diagnostics)
chrome.action.onClicked.addListener(async () => {
console.log("Extension clicked β€” starting PR count...");
const tabs = await chrome.tabs.query({ url: "https://github.com/*" });
if (!tabs.length) {
console.warn("No matching GitHub tabs open.");
return;
}
@nsdevaraj
nsdevaraj / UI.txt
Created June 29, 2025 08:14
Teams addon
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Teams Email Bridge [?] [Settings]β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ πŸ“§ Quick Compose β”‚
β”‚ πŸ“‹ Templates β”‚
β”‚ πŸ‘₯ Recent Contacts β”‚
β”‚ πŸ“ Sent History β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
@nsdevaraj
nsdevaraj / chapters.sh
Created April 27, 2025 06:39
create sub folders in a go!
mkdir -p chapter1/1.{1,2,3,4,5,6}
@nsdevaraj
nsdevaraj / package.json
Created April 5, 2025 03:45
mcp with socket
{
"type": "module",
"dependencies": {
"@coinpaprika/api-nodejs-client": "^2.0.0",
"@modelcontextprotocol/sdk": "^1.7.0",
"ws": "^8.18.1",
"zod": "^3.24.2"
}
}