Skip to content

Instantly share code, notes, and snippets.

View icyJoseph's full-sized avatar

Joseph icyJoseph

View GitHub Profile
@0
0 / bluetooth_serial.md
Last active May 15, 2024 07:01
Connecting a Bluetooth device for serial communication on Arch Linux.

The following are instructions for connecting a Bluetooth device for serial communication on Arch Linux using BlueZ 5.31.

Prerequisites

The following packages are required:

  • bluez: bluetoothd
  • bluez-utils: bluetoothctl, rfcomm
@paulirish
paulirish / what-forces-layout.md
Last active July 24, 2024 09:43
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@bvaughn
bvaughn / LICENSE.md
Last active November 9, 2023 07:13
Advanced example for manually managing subscriptions in an async-safe way using hooks

The MIT License (MIT)

Copyright © <year> <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

@sushruth
sushruth / pipeable.ts
Last active September 19, 2021 02:40
Type safe pipe operator equivalent
class Pipeable<I> {
constructor(public value: I) { }
public pipe<O>(fn: (input: I) => O) {
const output = fn(this.value);
return Object.assign(new Pipeable(output).pipe, {
value: output
});
}
}
@sushruth
sushruth / pipeable.ts
Created September 18, 2021 15:49
Another type safe pipe equivalent
class Pipeable<I> {
constructor(public value: I) {}
public pipe<O>(fn: (input: I) => O) {
const output = fn(this.value);
return {
p: new Pipeable(output).pipe,
value: output,
};
}
@MidSpike
MidSpike / readme.md
Last active July 19, 2024 20:45
CVE-2022-23812 | RIAEvangelist/node-ipc is malware / protest-ware
@Widdershin
Widdershin / ssr.md
Last active May 1, 2024 17:36
The absurd complexity of server-side rendering

In the olden days, HTML was prepared by the server, and JavaScript was little more than a garnish, considered by some to have a soapy taste.

After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user's browser. While some would decry this new-found intimacy, the age of interactivity had begun.

But all was not right in the world. Somewhere along the way, we had slipped. Our pages went uncrawled by Bing, time to first meaningful paint grew faster than npm, and it became clear: something must be done.

And so it was decided that the applications first forged for the browser would also run on the server. We would render our HTML using the same logic on the server and the browser, and reap the advantages of both worlds. In a confusing series of events a name for this approach was agreed upon: Server-side rendering. What could go wrong?

In dark rooms, in hushed tones, we speak of colours.