Skip to content

Instantly share code, notes, and snippets.

View billywhizz's full-sized avatar
🤓
always be learning

Andrew Johnston billywhizz

🤓
always be learning
View GitHub Profile
@kamilogorek
kamilogorek / _screenshot.md
Last active May 2, 2024 13:48
Clutter-free VS Code Setup
image
@kprotty
kprotty / lz4_block.zig
Last active January 2, 2024 11:14
Simple LZ4 block enc/dec in 100 LOC
const assert = @import("std").debug.assert;
fn compressBlock(writer: anytype, src: []const u8) !void {
var table = [_]u32{0} ** 4096; // size is pow2. bump to match more. ideal = (0xffff+1) / sizeof(u32)
var anchor: u32 = 0;
if (src.len > 12) { // LZ4 spec restriction: last match must start 12b before end of block.
var pos: u32 = 0;
while (pos + 4 < src.len - 5) { // LZ4 spec restriction: last 5b are always literal.
const blk: u32 = @bitCast(src[pos..][0..4].*);
@guest271314
guest271314 / javascript_engines_and_runtimes.md
Last active May 14, 2024 18:15
A list of JavaScript engines, runtimes, interpreters

V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++. It is used in Chrome and in Node.js, among others. It implements ECMAScript and WebAssembly, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

SpiderMonkey is Mozilla’s JavaScript and WebAssembly Engine, used in Firefox, Servo and various other projects. It is written in C++, Rust and JavaScript. You can embed it into C++ and Rust projects, and it can be run as a stand-alone shell. It can also be [compiled](https://bytecodealliance.org/articles/making-javascript-run-fast-on

@osy
osy / tpm-rant.md
Last active April 14, 2024 06:02
TPM provides zero practical security

TPM provides zero practical security

TPM (Trusted Platform Module) is as useful for preventing real attackers as the TSA is at preventing real terrorists. The architecture is fundamentally flawed and most existing implementations are completely broken. I thought this argument was settled decades ago[1] when "trusted computing" was introduced mostly as a way to provide DRM and ownership capabilities to organizations. It has largely failed to impact the consumer market when it was introduced back in the early 2000s. However, recently there seems to be a movement by certain parties to reintroduce this failed product back to the market. Microsoft argues that in order to use Windows 11, you need TPM 2.0 compatible hardware because[2]:

The Trusted Platform Module(TPM) requirement ena

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fabiospampinato
fabiospampinato / fast-npm-run.sh
Last active March 27, 2024 16:38
20x faster replacement for "npm run"
# 20x faster replacement for "npm run"
# - It supports scripts executing a built-in shell function
# - It supports scripts executing a binary found in PATH
# - It supports scripts executing a binary found in node_modules
# - It supports passing arguments and options to scripts
# - It supports reading scripts either via ripgrep (fast) or via jq (slower, but safer)
# - It adds ./node_modules/.bin to the $PATH
# - It handles gracefully when a script has not been found
# - It handles gracefully when "&", "&&", "|", "||", or ENV variables are used, falling back to "npm run"

Building Chrome V8 on Windows

In order to be able to build v8 from scratch on Windows for x64, please follow the following steps.

These instructions were updated to work with Windows 11 Build 10.0.22621, but this should also work on WInodws 10

NOTE: While the Chrome team does provide decent documentation, there are some nuances and other additional steps that must be done for v8 to compile on Windows.

Documentation:

@mcollina
mcollina / principles.md
Last active May 18, 2023 18:27
Matteo's Technical principles

Matteo Technical Principles

1. Conway’s Law is paramount.

Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

In order to design a piece of software we need to “design” the team that is going to produce it.

2. Developer Experience is key to productivity

@christianparpart
christianparpart / terminal-synchronized-output.md
Last active May 16, 2024 16:08
Terminal Spec: Synchronized Output

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.