Skip to content

Instantly share code, notes, and snippets.

@aswinsekar
aswinsekar / emlgenerate.py
Created May 22, 2025 10:37
EML generator, Requires python3
import os
from email.message import EmailMessage
from datetime import datetime, timedelta
import random
# Configuration
OUTPUT_DIR = "eml_dump_varied"
EMAIL_COUNT = 500 # Total emails to generate
SIZES = [1024, 1024*1024, 10*1024*1024] # 1KB, 1MB, 10MB
DOMAINS = ["example.com", "testmail.org", "mailbox.net"]
@aswinsekar
aswinsekar / ExpectedOutput.js
Created August 7, 2024 20:30
Terser Minification Issue
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[37043],{725438:(t,e,n)=>{n.d(e,{P:()=>o}),n(314846),n(327458),n(469655),n(194364);var s=n(879783),i=n(8065);class o{constructor(t){this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let n=0;n<this.animations.length;n++)this.animations[n][t]=e}attachTimeline(t){const e=this.animations.map((e=>{if(!(0,i.J)()||!e.attachTimeline)return e.pause(),(0,s.y)((t=>{e.time=e.duration*t}),t);e.attachTimeline(t)}));return()=>{e.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}stop(){this.runAll("sto
@aswinsekar
aswinsekar / flourish_credit_routing.js
Last active August 25, 2024 09:09
Routing code for Flourish book - https://flourishbooks.app/credits/ credits page
## Redex - Reducible Expressions
![[Pasted image 20231230121928.png]]
## Continuation
- The Context in which the `redex` is evaluated
- An expression within a whole
- The place is which a redex's value is `returned to`
- The rest of the program
### Why care about continuation?
Evaluation is extremely regular
1) Split the redex and continuation
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:[email protected]
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@aswinsekar
aswinsekar / IANA timezone database.txt
Created September 16, 2020 11:11
IANA maintained timezone database for latest application development
codes coordinates TZ comments
AD +4230+00131 Europe/Andorra
AE,OM +2518+05518 Asia/Dubai
AF +3431+06912 Asia/Kabul
AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
AQ -6617+11031 Antarctica/Casey Casey
AQ -6835+07758 Antarctica/Davis Davis
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville
AQ -6736+06253 Antarctica/Mawson Mawson
@aswinsekar
aswinsekar / useTrailProp.js
Created August 16, 2020 13:08
This hook will not return anything. It will log into console, the changed props, from the previous render.
/**
* usage
*
* const MyComp = (props) => {
useTraceUpdate(props)
return <span />;
};
*/
import { useRef, useEffect } from "react";
@aswinsekar
aswinsekar / mac.sh
Last active March 5, 2023 17:32
mac specific commands
# to restart touchbar, when it is not responding or not working as expected
sudo pkill TouchBarServer
sudo killall “ControlStrip”
# 7zip handling in mac
brew install p7zip
p7zip x a.7z #extract module
@aswinsekar
aswinsekar / terminal.sh
Last active September 12, 2023 14:49
Bash Terminal command reference
#will list the calendar in the linux
cal
#Generate a sha256 sum of text
# for mac
echo -n <text> | shasum -a 256
# for linux
echo -n <text> | sha256sum
# sort and list the directories by size
@aswinsekar
aswinsekar / git.sh
Last active August 12, 2024 14:09
Git script Files
# delete local branches that no longer have remote reference
git fetch -p && for branch in $(git for-each-ref --format '%(refname) %(upstream:track)' refs/heads | awk '$2 == "[gone]" {sub("refs/heads/", "", $1); print $1}'); do git branch -D $branch; done
# delete files that are being ignored by git(.gitignore) under a directory
git clean -xdn # dry run all the files that will list all the gitignore files under the directory
git clean -xdf # to clean the files that are ignored
# to delete all the files in the git repo, execute the command in the root directory
# clone all repos of an org (requires ruby1.9+)
curl -s https://api.github.com/orgs/[ORGANIZATION]/repos | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} ]}'
// IIFE - to print the trace where alert raised from
// Doesn't impact the alert behavior or any other behavior of your front end
// Add this code in your javascript or run it in console of your browser
// After adding, console will have stack trace of the alert printed
(function(proxied) {
window.alert = function() {
console.trace();
return proxied.apply(this, arguments);
};