Idea from https://youtu.be/9IULfQH7E90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; // ¯\\_(ツ)_/¯ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def resolve_ae(text): | |
""" | |
This function takes a text input in Central Kurdish (Sorani) script and performs a series of character replacements | |
to standardize variations in the script. Specifically, it addresses cases where the character 'ە' (Arabic letter | |
AE) may be used in different contexts. | |
""" | |
# First replace all occurrences of 'ه' with 'ە' | |
text = re.sub("ه", "ە", text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <std/mem.pat> | |
#include <std/io.pat> | |
#include <std/sys.pat> | |
enum ConstructorIDType : u32 { | |
CID_TLSTYPE = 0x12eb4386, | |
CID_NATCONST = 0x8ce940b1, | |
CID_NATVAR = 0x4e8a14f0, | |
CID_EXPRNAT = 0xdcb49bd8, | |
CID_EXPRTYPE = 0xecc9da78, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from 'crypto'; | |
export type SemElement = [string, (value: any | PromiseLike<any>) => void]; | |
export class Semaphor { | |
private curQueue: Map<string, SemElement>; | |
private readonly max: number; | |
private callbackQueue: SemElement[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Commit Convention Hook | alemi <[email protected]> May 2022 | |
# | |
# A simple git hook to enforce (sort of) Commit Convention. | |
# www.conventionalcommits.org | |
# | |
# This script uses bash builtin regex matching, so it's not sh compatible. | |
# | |
# Commit message will be stripped of comments (lines starting with #) and matched |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
blockchain = [] | |
difficulty = 3 | |
mine_pattern = '0' * difficulty | |
def add_block(data): | |
block = make_block(data) | |
block['prev'] = '' if blockchain == [] else blockchain[-1]['hash'] | |
mine_block(block) |
RIAEvangelist/node-ipc is malware / protestware
The RIAEvangelist/node-ipc
module contains protestware peacenotwar.
Excerpt from RIAEvangelist/node-ipc:
as of v11.0.0 & v9.2.2 this module uses the peacenotwar module.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { StoreSession} from "telegram/sessions"; | |
import { TelegramClient } from "telegram/client/TelegramClient"; | |
import { Api } from "./tl"; | |
import { generateRandomBigInt, readBigIntFromBuffer, readBufferFromBigInt, sha256 } from "telegram/Helpers"; | |
import bigInt from "big-integer"; | |
const apiId = ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var RequireToImportPlugin = { | |
name: 'require-to-import', | |
setup({ onResolve, onLoad, esbuild }) { | |
function matchBrace(text, from) { | |
if (!(text[from] === '(')) return -1; | |
let i, k = 1; | |
for (i = from + 1; i < text.length && k > 0; ++i) { | |
if (text[i] === '(') k++; | |
if (text[i] === ')') k--; | |
} |
NewerOlder