Skip to content

Instantly share code, notes, and snippets.

@santaklouse
santaklouse / README.md
Created October 3, 2023 20:58
share text or images (tmp store on free anon file servers)

Create patch

create raw binary git patch file for untracked files only (exclude: zip archives/files/ directory/*.patch files)

$ { for next in $( git ls-files --others --exclude-standard --exclude=*.zip --exclude=files/* -x '*.patch') ; do git --no-pager diff -p --ignore-space-change --ignore-cr-at-eol --raw --binary -b -w --no-index /dev/null $next; done; } > untracked.patch

Apply patch

show information about changes that will be applied

import { pipeline } from 'node:stream/promises'
import { Writable } from 'node:stream'
import fs from "fs";
import StreamObject from "stream-json/streamers/StreamObject.js";
return new Promise(async (resolve) =>
await pipeline(
fs.createReadStream(this.cacheFileFullPath(filename)),
StreamArray.withParser(),
new Writable({
class WorkerWrapper extends EventEmitter {
#worker;
#ee = new EventEmitter();
constructor(worker) {
super();
this.#worker = worker;
console.log(`worker.js `, worker);
@santaklouse
santaklouse / rsync.sh
Last active September 8, 2023 01:05
copy missed files with rsync
rsync --ignore-existing -a --progress -W -v -r --include="*/" --include="*.jpg" --exclude="*" /home/fignelim/tools/Fignel-tools/export-elements/out/ /home/fignelim/tools/feature_test/out/
#get all images count in dir
find ./feature_test/out/ -type f -name '*.jpg' | wc -l
diff -qr Fignel-tools/export-elements/out/ feature_test/out/
@santaklouse
santaklouse / indes.js
Created August 14, 2023 17:32
download json or image for selected Figma design
// run this function in dev console
function downloadBlob(blob, name = 'file.txt') {
// Convert your blob into a Blob URL (a special url that points to an object in the browser's memory)
const blobUrl = URL.createObjectURL(blob);
// Create a link element
const link = document.createElement("a");
// Set link's href to point to the Blob URL
link.href = blobUrl;
@santaklouse
santaklouse / cmp.py
Created August 14, 2023 06:04
Calculate two images and calculate pixel difference between images and SSIM (Similarity) Score in percents.
#!/usr/bin/env python3
# Compares two images and calculate pixel difference between images and SSIM (Similarity) Score in percents.
# Images should have same dimentions,
# BUT
# if dimentions of the second image is bigger than first, script will try to find first image on second by template and crop second.
import sys
import os.path
@santaklouse
santaklouse / README.md
Last active August 2, 2022 13:34 — forked from Roni-Carta/wp-wordlist.sh
wp-wordlist helps you create wordlist of all the Wordpress' Themes and Plugins available

fuzz target.com wordpress site:

./fuzz.wp.sh https://target.com
version: "3"
services:
delegated:
image: santaklouse/delegated:latest
command: "-P1080 SERVER=socks SSLTUNNEL=127.0.0.1:4444"
ports:
- "1080:1080"
restart: always
i2p:
image: santaklouse/i2p:latest