Skip to content

Instantly share code, notes, and snippets.

View Bannerets's full-sized avatar
🌺
h

Bannerets

🌺
h
  • ʻOumuamua
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active June 11, 2024 15:27
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

module type T = sig
module type S
end
module T = struct
module type S = T
end
module type K_Bool = functor (X : T) (Y : T) -> T
@Hirrolot
Hirrolot / CoC.ml
Last active May 24, 2024 23:57
How to implement dependent types in 80 lines of code
type term =
| Lam of (term -> term)
| Pi of term * (term -> term)
| Appl of term * term
| Ann of term * term
| FreeVar of int
| Star
| Box
let unfurl lvl f = f (FreeVar lvl)
@acutmore
acutmore / README.md
Last active January 21, 2024 20:30
Emulating a 4-Bit Virtual Machine in (TypeScript\JavaScript) (just Types no Script)

A compile-time 4-Bit Virtual Machine implemented in TypeScript's type system. Capable of running a sample 'FizzBuzz' program.

Syntax emits zero JavaScript.

type RESULT = VM<
  [
    ["push", N_1],         // 1
    ["push", False],       // 2
 ["peek", _], // 3
/*
A collection of tests where Flow and TypeScript might have different behavior
Some tests are borrowed from https://github.com/vkurchatkin/typescript-vs-flow
Some tests now have the same behavior as the new versions of Flow/TS have fixed the bugs and improved type safety
*/
/* 1. Accessing unknown properties on objects */
@zerobias
zerobias / nicknames.md
Last active June 16, 2022 07:44
nicknames
16.06.2022
Дима Zerobias
01.03.2022
⛴➡️🍆
@MaxGraey
MaxGraey / uuid.js
Last active March 14, 2018 23:51
Fast RFC-compliant UUID v4 Generator
const charset = '0123456789abcdef'.split('');
const randomset = new Uint8Array(16);
export function uuid() {
let rand = 0;
for (let i = 0; i < 16; i++) {
if (rand < 2) {
rand += Math.random() * (1 << 24);
}
randomset[i] = rand & 0xFF;
@aquigni
aquigni / OneFileLinux.sh
Created February 24, 2018 05:54
OneFileLinux.efi installation script for macOS
#!/bin/sh
cd ~/Downloads/
### Checking if Homebrew is installed:
command -v brew >/dev/null 2>&1 || {
echo >&2 "Installing Homebrew:"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
}
### Getting wget:
@zerobias
zerobias / fs-extra.js
Last active April 30, 2018 14:38
Flow typings delaration for fs-extra
declare module 'fs-extra' {
import type {
createReadStream as createReadStreamType,
createWriteStream as createWriteStreamType,
} from 'fs'
declare export var createReadStream: $PropertyType<
$Exports<'fs'>,
'createReadStream',
>
@Piterden
Piterden / tg_parse.js
Last active January 27, 2018 18:20
Telegram API page parser. Run this in the console on tg API page
Array.from(document.querySelectorAll('h4')).map((el) => {
const nextEl = el.nextElementSibling
const tableEl = nextEl.nextElementSibling
return `
/**${nextEl.innerText.replace(/(.{1,72}\s)\s*?/g, '\n * $1')}
*/
export type ${el.innerText} = {
` + Array.from(tableEl.children[0].children).slice(1).map((tr) => {
const arr = Array.from(tr.children)