Skip to content

Instantly share code, notes, and snippets.

View umaar's full-sized avatar

Umar Hansa umaar

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 25, 2024 06:09
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@jpillora
jpillora / test.js
Last active April 6, 2024 01:27
async javascript test
const MAX_INFLIGHT = 4;
const TOTAL = 100;
// the given dummy api supports a maximum of 4 of inflight requests.
// the given code is correct, but it is slow because it processes elements serially.
// your task is to process 100 elements as fast as possible.
// run this code with "node/bun test.js".
// it should print "pass".
// no external dependencies are allowed.
async function run(elements) {
// ============
@kamilogorek
kamilogorek / _screenshot.md
Last active April 9, 2024 21:18
Clutter-free VS Code Setup
image
@testanull
testanull / SharePwn_public.py
Created December 15, 2023 07:31
SharePoint Pre-Auth Code Injection RCE chain CVE-2023-29357 & CVE-2023-24955 PoC
# -*- coding: utf-8 -*-
import hashlib
import base64
import requests, string, struct, uuid, random, re
import sys
from collections import OrderedDict
from sys import version
from urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
# too lazy to deal with string <-> bytes confusion in python3 so forget it ¯\_(ツ)_/¯
@levelsio
levelsio / gist:5bc87fd1b1ffbf4a705047bebd9b4790
Last active April 13, 2024 17:00
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@khalidx
khalidx / node-typescript-esm.md
Last active April 22, 2024 15:40
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

@thekitchenscientist
thekitchenscientist / gist:56969191bd2f33849fb2dfa10cfae0d9
Created October 14, 2023 17:30
Recreation of textfx.withgoogle.com locally using dolphin-2.1-mistral-7b, llama-cpp-python and streamlit
# -*- coding: utf-8 -*-
"""
Prompts by Google https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/textfx
@author: thekitchenscientist and Bing Chat (conversion of prompts and basic app framework)
"""
class TextFX:
# Initialize the list attribute with an empty list
@1Marc
1Marc / reactive.js
Last active March 29, 2024 01:43
Vanilla Reactive System
// Credit Ryan Carniato https://frontendmasters.com/courses/reactivity-solidjs/
let context = [];
export function untrack(fn) {
const prevContext = context;
context = [];
const res = fn();
context = prevContext;
return res;

Reddit Dec 5, 2022 10:46 AM:

Hi Christian,

I hope all is well!

I’m reaching out because we noticed a spike in Apollo's request rate on December 2nd. It was from approximately 14:17 to 14:23 UTC to /messages/inbox that went up by around 35% before returning to baseline. We are hoping you could help us understand what might have happened.

The source IPs were in AWS us-west-2: redacted, redacted, and redacted and had the Apollo UA server:apollo-backend:v1.0 (by /u/iamthatis) contact me@christianselig.com

@hyperupcall
hyperupcall / settings.jsonc
Last active March 31, 2024 22:52
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{