Skip to content

Instantly share code, notes, and snippets.

View vsDizzy's full-sized avatar
🚐
Avoiding busification

vsDizzy

🚐
Avoiding busification
View GitHub Profile
@vsDizzy
vsDizzy / hash.ts
Last active October 28, 2022 19:17
export function hash(s: string) {
return [].reduce.call(s, (p, c) => (p << 5) - p + c.charCodeAt(0), 0)
}
@vsDizzy
vsDizzy / p2p.ts
Created November 12, 2020 06:38
WebRTC sample hello world
interface Signaller {
send(data: unknown): void;
onmessage(data: unknown): void;
}
const ls = {
send: (x) => rs.onmessage(x),
} as Signaller;
const rs = {
send: (x) => ls.onmessage(x),
@vsDizzy
vsDizzy / generateId.ts
Created January 7, 2021 14:25
Generate string id from current time in milliseconds.
export function generateId() {
return new Date().getTime().toString(36)
}
@vsDizzy
vsDizzy / transform.md
Last active January 30, 2025 20:44
Transform matrix

Given two images a frame and a content. Calculate transform matrix for picture in picture that will fit the content into the frame.

@vsDizzy
vsDizzy / program.py
Created December 9, 2024 18:28
PDF watermark remover
import pymupdf, sys, re
doc = pymupdf.open(sys.argv[1])
for xref in range(1, doc.xref_length()):
pattern = r"(/Private /Watermark)|(/Name \(Watermark\))"
text = doc.xref_object(xref)
if re.search(pattern, text):
doc._deleteObject(xref)
@vsDizzy
vsDizzy / rbx-mui.ps1
Created January 1, 2025 00:25
Roblox muilti-instancer
# Roblox muilti-instancer
# v0.1.0
$createdMutex = $false
New-Object System.Threading.Mutex($true, "ROBLOX_singletonMutex", [ref] $createdMutex)
if (-Not $createdMutex) {
Write-Host "Please close all Roblox instances." -ForegroundColor Red
} else{
Write-Host "Now you can open multiple Roblox instances." -ForegroundColor Green
@vsDizzy
vsDizzy / Portfolio - Pavel Kopytin.md
Last active February 4, 2025 13:55
Portfolio - Pavel Kopytin

Portfolio - Pavel Kopytin

  1. Landing page example - https://flashsha.re
  2. Space flight animation - https://github.com/vsDizzy/fly-space
  3. Audio visualizer - https://github.com/vsDizzy/audio-freq-sample
  4. WebGL POC - https://github.com/vsDizzy/webgl
  5. Drag items POC - https://github.com/vsDizzy/drag-app
  6. React hot reload POC - https://github.com/vsDizzy/react-refresh-poc
  7. RPC library - https://github.com/vsDizzy/rpc-lib
  8. Library converting Chrome callbacks to promises - https://github.com/vsDizzy/chrome-async