Skip to content

Instantly share code, notes, and snippets.

View tonivj5's full-sized avatar
👨‍🎓
Studying...

Toni Villena tonivj5

👨‍🎓
Studying...
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active April 25, 2024 23:45
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@rameerez
rameerez / telegram-mtproxy.md
Last active April 25, 2024 18:13
Telegram Proxy How-To: complete and up-to-date MTProxy tutorial

How to set up a Telegram Proxy (MTProxy)

This tutorial will teach you how to set up a Telegram MTProxy on an Ubuntu 22.04 sever using AWS Lightsail, although you can use any other Linux distribution and cloud provider.

Using a Telegram proxy is a safe, easy and effective way of overcoming Telegram bans. It's useful, for example, to keep using Telegram under tyrannical regimes, or to circumvent judges' decisions to block Telegram.

Telegram proxies are a built-in feature in all Telegram apps (both mobile and desktop). It allows Telegram users to connect to a proxy in just one or two clicks / taps.

Telegram proxies are safe: Telegram sends messages using their own MTProto secure protocol, and the proxy can only see encrypted traffic – there's no way for a proxy to decrypt the traffic and read the messages. The proxy does not even know which Telegram users are using the proxy, all the proxy sees is just a list of IPs.

@schacon
schacon / better-git-branch.sh
Created January 13, 2024 18:41
Better Git Branch output
#!/bin/bash
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NO_COLOR='\033[0m'
BLUE='\033[0;34m'
YELLOW='\033[0;33m'
NO_COLOR='\033[0m'
@pilcrowOnPaper
pilcrowOnPaper / crypto-random.ts
Last active January 3, 2024 18:55
Cryptographically strong Math.random(). Generate cryptographically strong random float between 0-1. Uses 52 bits instead of 32.
function random(): number {
const buffer = new ArrayBuffer(8);
const bytes = crypto.getRandomValues(new Uint8Array(buffer));
// sets the exponent value (11 bits) to 01111111111 (1023)
// since the bias is 1023 (2 * (11 - 1) - 1), 1023 - 1023 = 0
// 2^0 * (1 + [52 bit number between 0-1]) = number between 1-2
bytes[0] = 63;
bytes[1] = bytes[1] | 240;
class PathMe {
moves: string[] = [];
constructor() {
this.moves = [];
return this;
}
moveTo(x: number, y: number) {
@kevinswiber
kevinswiber / typescript-hook.js
Last active November 27, 2023 15:15
Run the TypeScript compiler in watch mode while running Node.js in watch mode. Yowza.
// Usage:
// node --import=./typescript-hook.js --watch ./dist/index.js
//
// Make changes to your TypeScript code, have it automatically
// recompiled, and see it reloaded in Node.js.
//
// This file is intended to be used as a Node.js preload module.
// The TypeScript compiler (tsc) will be run in watch mode.
// This is useful while running Node.js itself runs in watch mode.
//
@MinskLeo
MinskLeo / Install execa
Created September 17, 2023 16:30
NX run-command interactive executor
Install version ^5.1.1 because version 6 is ESM only.
GitHub issue about it:
https://github.com/sindresorhus/execa/issues/489
yarn add -D execa@^5.1.1
@fabiospampinato
fabiospampinato / use_boxer.ts
Created May 1, 2023 17:34
A little Voby hook for rendering hit boxes around each element on the page
/* IMPORT */
import {$$} from 'voby';
import {useEffect} from '~/hooks';
/* MAIN */
const useResizeObserver = ( ref: $<Element | undefined>, fn: ResizeObserverCallback, options: ResizeObserverOptions = {} ): void => {
@alexanderson1993
alexanderson1993 / README.md
Last active April 2, 2024 04:52
Prisma-like Migrations and type safety with Kysely
@fabiospampinato
fabiospampinato / lag_bar.tsx
Created April 23, 2023 19:56
My lag bar implementation for Voby
/* IMPORT */
import {$, $$, useEffect, useInterval} from 'voby';
/* STYLE */
css`
:root {
--lag-bar-color-bg: var(--color-black-bg);