Skip to content

Instantly share code, notes, and snippets.

View bb010g's full-sized avatar
💭
questionable ideas, made with 💛

bb010g bb010g

💭
questionable ideas, made with 💛
View GitHub Profile
#include <stdio.h>
#include <stdint.h>
// Philips Sonicare NFC Head Password calculation by @atc1441 Video manual: https://www.youtube.com/watch?v=EPytrn8i8sc
uint16_t CRC16(uint16_t crc, uint8_t *buffer, int len) // Default CRC16 Algo
{
while(len--)
{
crc ^= *buffer++ << 8;
int bits = 0;
do
@WebReflection
WebReflection / esx.md
Last active April 22, 2024 14:12
Proposal: an ESX for JS implementation
@LAK132
LAK132 / results.c
Last active December 5, 2023 12:57
Result types in C
#ifndef __cplusplus
# define decltype typeof
# include <stdbool.h>
#endif
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#define TOKEN_CONCAT_EX(x, y) x##y
#define TOKEN_CONCAT(x, y) TOKEN_CONCAT_EX(x, y)
@t3chguy
t3chguy / faq.md
Last active April 11, 2022 20:01
Element Spaces Beta FAQ

Why can't I see some rooms in a space

Currently you can only see rooms you are either joined to or which have History Visibility set to Anyone. Without one of those you are unable to fetch details about the room such as name/avatar/topic/members which is needed for the UI. The solution for this in the long term is matrix-org/matrix-spec-proposals#3173 which will allow you to fetch the necessary details for any room if you are able to join it without requiring an invite.

For the private space/rooms edge of this is matrix-org/matrix-spec-proposals#3083 which will allow members of a space access to a room which would also grant them access to its metadata to be able to see it prior to joining it.

Another situation which might cause this issue is if you are joined to some rooms but they are contained within a subspace you are not joined to; unsure of what the final solution will be here but once /peek MSC is stable that might provide a solution - https://github.com/vector-im/ele

@rampion
rampion / HyperList.hs
Last active April 6, 2024 19:16
Demonstration of how the Hyperfunction implementation of list works.
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -Wall -Werror -Wextra -Wno-name-shadowing #-}
module HyperList where
import Data.Function ((&))
newtype a -&> b = Hyp {invoke :: (b -&> a) -> b}

The Freenode resignation FAQ, or: "what the fuck is going on?"

IMPORTANT NOTE:

It's come to my attention that some people have been spamming issue trackers with a link to this gist. While it's a good idea to inform people of the situation in principle, please do not do this. By all means spread the word in the communities that you are a part of, after verifying that they are not aware yet, but unsolicited spam is not helpful. It will just frustrate people.

Update 3 (May 24, 2021)

A number of things have happened since the last update.

It appears that rasengan (Andrew Lee) of Private Internet Access believes that ownership of the company Freenode Ltd. gives him the right to unilaterally replace the current staff team.

We may have had our disagreements with staff, but freenode being run by a volunteer team, using servers provided by sponsors, is a key reason that we appreciate freenode.

As such, we do not believe that such a unilateral replacement by a corporate interest is appropriate.

If this attemped takeover by Andrew Lee continues, we will be advocating to move our communities elsewhere.

Context: Fuchs' leaked (not by him) draft resignation letter that caused Andrew Lee to come onto #freenode: https://fuchsnet.ch/privat/fn-resign-letter.txt

@foone
foone / dam.proto
Created March 1, 2021 17:14
The DAM 3D format of Matterport
// type i
message DAMFile {
repeated Chunk chunk = 1;
repeated QuantizedChunk quantized_chunk = 2;
}
// type "o"
message Chunk {
required Vertices vertices = 1;
required Faces faces = 2;
@jjrv
jjrv / LICENSE
Last active March 7, 2024 10:23
SRLAB2 and OKLAB
Copyright (c) 2020- Juha Järvi
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR

With scoped effects, handlers must be a part of the program

It is seductive to imagine that effect handlers in an algebraic effect system are not part of the program itself but metalanguage-level folds over the program tree. And in traditional free-like formulations, this is in fact the case. The Eff monad represents the program tree, which has only two cases:

data Eff effs a where
  Pure :: a -> Eff effs a
  Op :: Op effs a -> (a -> Eff effs b) -> Eff effs b

data Op effs a where