Skip to content

Instantly share code, notes, and snippets.

@sumitpore
sumitpore / prompt.md
Created March 27, 2026 05:21
Paper Plane Website Prompt

Here's the rewritten spec for a single plain HTML file:


Paper Planes — Cinematic Scroll-Driven Experience (Plain HTML)

Build a cinematic scroll-driven paper plane experience using Three.js (loaded via CDN). The entire experience is a single .html file with embedded CSS and JavaScript. The page is a scroll-controlled animation mapped to a 500vh scroll runway (600vh on mobile below 768px width). No frameworks — just vanilla HTML, CSS, and JS with Three.js. The page has no visible UI chrome — just the 3D scene, text, and effects.


#!/usr/bin/env python3
import re
import sys
import pyperclip
# character replacements: typographic to ASCII
replacements = {
# quotes and apostrophes
'‘': "'", # left single quotation mark
@sumitpore
sumitpore / .cursorfile
Last active January 20, 2025 05:34
Temp cursorfiles
This file has been truncated, but you can view the full file.
This comprehensive guide outlines best practices,
conventions,
and standards for development with modern web technologies including VueJS,
ReactJS,
NextJS,
Redux,
TypeScript,
JavaScript,
HTML,
CSS,
@sumitpore
sumitpore / r-debug.php
Created November 26, 2022 09:16
R Debug Plugin Created by Andrey "Rarst" Savchenko
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: https://www.rarst.net/
License: MIT
*/
@sumitpore
sumitpore / pQuery.js
Created April 1, 2021 02:41 — forked from niyazpk/pQuery.js
Add or update query string parameter
// Add / Update a key-value pair in the URL query parameters
function updateUrlParameter(uri, key, value) {
// remove the hash part before operating on the uri
var i = uri.indexOf('#');
var hash = i === -1 ? '' : uri.substr(i);
uri = i === -1 ? uri : uri.substr(0, i);
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
if (uri.match(re)) {
@sumitpore
sumitpore / gist:d9c6434e16088f558149d383c02e0541
Created September 17, 2020 08:06
WordPress derive Timezone from gmt_offset option
function wp_timezone_object_from_gmt_offset() {
$min = 60 * get_option('gmt_offset');
$sign = $min < 0 ? "-" : "+";
$absmin = abs($min);
$tz = sprintf("%s%02d%02d", $sign, $absmin/60, $absmin%60);
return new DateTimeZone( $tz );
}
@sumitpore
sumitpore / modifyHtmlTagAttrsInString.php
Created August 19, 2020 03:56
Modify Html Tag Attributes in the HTML String
<?php
/**
* Modifies html tag attributes in the html string
*
* Remember, this will autofix the passed html. So if invalid html string is sent (e.g. `a` tag w/o end),
* then the o/p returned by function will be valid html string.
*
* Examples:
* 1. modifyHtmlTagAttrsInString(
@sumitpore
sumitpore / git-diff-commands.md
Last active August 4, 2020 11:48
Git Diff Commands

See changes which are going to be staged (i.e. before doing git add)

git diff

See changes which are staged (i.e. after doing git add)

git diff --cached

See Changes which were commited in last commit (i.e. after doing git commit)

git diff HEAD^..HEAD

@sumitpore
sumitpore / phpv8js-installer.sh
Last active July 18, 2020 07:15
Installing v8js pecl extension on php 7.3
#!/bin/bash
echo "=================================="
echo "Installing Dependencies"
echo "=================================="
sudo apt-get update
sudo apt-get install \
git \
build-essential \
@sumitpore
sumitpore / closest.js
Created May 3, 2020 07:28
jQuery closest's in Pure JavaScript
if (window.Element && !Element.prototype.closest) {
Element.prototype.closest =
function(s) {
var matches = (this.document || this.ownerDocument).querySelectorAll(s),
i,
el = this;
do {
i = matches.length;
while (--i >= 0 && matches.item(i) !== el) {};
} while ((i < 0) && (el = el.parentElement));