Skip to content

Instantly share code, notes, and snippets.

View bcomnes's full-sized avatar
👽

Bret Comnes bcomnes

👽
View GitHub Profile
// WARNING: There's much more to know/do around hooks, and
// this is just a simplification of how these work.
// shared references, updated
// per each hook invoke
let execution = null;
let current = null;
let context = null;
let args = null;
@balupton
balupton / README.md
Last active January 4, 2022 07:27
MacOS / Linux Filesystem Adventures

MacOS / Linux Filesystem Adventures

Goal is to have a data store between MacOS and Linux (Ubuntu Server on a Raspberry Pi 4), with the main use case being for Plex Media Server.

The hard drive:

  • A single 12TB USB HDD.

The systems:

@WebReflection
WebReflection / my-libraries-in-bytes.md
Last active September 24, 2021 22:03
My libraries in bytes

Toward better libraries

I am recently re-branding my libraries as µ (micro), refactoring these when necessary, dropping IE < 11 support, improving the logic where possible, or providing a better, more robust, or faster, API.

In few words, on the right there is the modern version of libraries I've used for the last ~5 years in production or for side projects, and I suggest anyone having one of the earlier dependencies, to have a look at their modern, micro, counterpart.

How to read these tables

All sizes are minified, brotli compressed, and representing these two files, when possible:

@dvalfrid
dvalfrid / gist:72a203931a928dbc67e2da568b4c5547
Last active November 5, 2020 17:00
Control the POE fan with ubuntu

Rasparry PI - how to control your POE-fan in Ubuntu

Check if you have the POE-fan

cat /sys/class/thermal/cooling_device0/type

should give rpi-poe-fan

Create file

sudo vi /etc/udev/rules.d/50-rpi-fan.rules

What's SWR?

It's React Hooks for Remote Data Fetching, a hook designed to render data on demand.

import useSWR from 'swr'

function Profile() {
  const { data, error } = useSWR('/api/user', fetcher);
@roalcantara
roalcantara / XDG.cheat-sheet.md
Last active April 10, 2024 21:56
XDG cheat sheet

XDG - Base Directory Specification

Directories

Base

The intended use-case for BaseDirectories is to query the paths of user-invisible standard directories that have been defined according to the conventions of the operating system the library is running on.

@WebReflection
WebReflection / uce-vs-lit-element.md
Last active January 8, 2024 07:16
A very simple comparison table between uce and lit-element.

A very simple comparison table between these two libraries.

uce lit-element
version 1.11.9 2.4.0
license ISC (simplified MIT) BSD-3-Clause License
language JS w/ TS definition TS w/ JS transpilation
size ( brotli ) 9437b ES5 / 6811b ES2015+ 8634b ES5 / 6708b ES2015+
[1: the world as it is today]
regular identities are controlled by corporations:
https://twitter.com/jamieoliver
https://linktr.ee/jamieoliver
https://www.youtube.com/user/JamieOliver
https://www.youtube.com/watch?v=hTn8Uh1m0hg (11-character base 64 hash value)
@tornqvist
tornqvist / example-memo.js
Last active May 19, 2020 19:02
A series of examples illustrating a new component API I've been working on in conjunction with changes to nanohtml
var { html, render } = require('nanohtml')
var { Component, memo, onupdate } = require('nanohtml/component')
// This example illustrates how memo can be used to maintain form state.
// On first render, getInitialValues is called and read values either
// from the fields argument or from local storage.
// Whenever a field changes its value is persisted to local storage.
var Form = Component(function (fields, values = memo(getInitialValues)) {
var update = onupdate(function (fields, values) {
@media (prefers-color-scheme: dark) {
#main a { color: #bfdfff; }
body { background-color: #292a2d; }
#main a:hover { background-color: #000000; }
#main a:hover { color: #80ecff; }
#main a:hover { box-shadow: 0 0 7px #0080ff; }
#main a:hover { box-shadow: 0 0 7px #0080ff; }
}