Skip to content

Instantly share code, notes, and snippets.

View Munawwar's full-sized avatar
🍪
Cookies

Munawwar Firoz Munawwar

🍪
Cookies
View GitHub Profile
@kylecarbs
kylecarbs / claude-code-prompt.md
Created June 4, 2025 01:36
Claude Code v1.0.10

You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.

IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse. IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up the code). IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.

If the user asks for help or wants to give feedback inform

aasb = Unknown
action = Unknown
ad = Unknown
addh = Unknown
adsafe = Unknown
adtest = Ads test mode (when adtest=on, Google treats the query as a test so ad impressions aren’t counted)
adtest-useragent = Unknown
aec = Unknown
aep = Unknown
affdom = Unknown
@imownbey
imownbey / EdgeSSETransport.ts
Created March 9, 2025 21:12
Edge / Cloudflare Worker & Durable Object driven McpServer transport
import { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
import { JSONRPCMessage, JSONRPCMessageSchema } from '@modelcontextprotocol/sdk/types.js';
const MAXIMUM_MESSAGE_SIZE = 4 * 1024 * 1024; // 4MB
/**
* This transport is compatible with Cloudflare Workers and other edge environments
*/
export class EdgeSSETransport implements Transport {
private controller: ReadableStreamDefaultController<Uint8Array> | null = null;
@mebaysan
mebaysan / convert.sh
Last active April 13, 2025 05:20
Ubuntu Screen Recorder WEBM to MP4
#! /bin/bash
# sudo apt-get install ffmpeg
# if ffmpeg is not installed, install it
if ! [ -x "$(command -v ffmpeg)" ]; then
sudo apt-get install ffmpeg
fi
# if no arguments are given, print usage
import { useSignal, signal, effect } from '@preact/signals';
import { useLayoutEffect, useMemo, useRef } from 'preact/hooks';
/** @template T @typedef {T extends (infer U)[] ? U : never} Items */
/** @param {{ v, k?, f }} props */
const Item = ({ v, k, f }) => f(v, k);
/**
* Like signal.value.map(fn), but doesn't re-render.
@EllyLoel
EllyLoel / reset.css
Last active January 24, 2025 09:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/[email protected]/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/

0u+_W!+h_+h3_01d & InWithTheNew!

Modern Password Theory in a Nutshell

By Andrew Somers

In the Beginning, there was the "hard to read" paradigm

So... We've been taught now for years to make our passwords more secure by D0!n97h!n95L!k37h!5 ("doing things like this", i.e. substituting characters with numbers and so forth).

The theory was that by increasing the character set size, password entropy would improve — at the expense of being much harder to read, harder to remember, and harder to type into the hidden void that is the password field. This has long been accepted as "the way".

But does this actually improve password safety? The short answer is "not really".

Preact: Progressive Hydration

Preact now supports seamless progressive hydration.

Any component can throw during hydration (or new tree creation like a route change!), and if a component somewhere higher in the tree catches that via componentDidCatch, hydration gets paused.

Re-rendering the tree (via setState, etc) simply resumes hydration where it left off.

@Munawwar
Munawwar / daisy-chain.js
Last active July 13, 2021 11:51
Lodash chaining without importing the entire library
function chain(value) {
return {
/**
* @param {function|string} func function or function name (in chained value)
* @param {...any} args
*/
fn(func, ...args) {
if (typeof func === 'string') {
return chain(value[func](...args));
}
@Tinitto
Tinitto / generateGravatar.js
Last active September 16, 2023 00:23
Generate Gravatar or default to Initials Avatar
/**
This is in a Nodejs environment
*/
const crypto = require('crypto');
module.exports = (
email = '',
name = 'Anonymous',
initialsAvatarBackground = '000000',