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

TL;DR: what was the bug? (spoilers!): https://gist.github.com/trptcolin/6039cd454acfe6e820d13cbdce5e4064

@imbushuo
imbushuo / Vibrator.cs
Last active November 2, 2019 10:57
Turn your Apple Magic Trackpad 2 into a vibrator
using HidSharp;
using System.Linq;
namespace ForceTouchTrigger
{
class Program
{
static void Main(string[] args)
{
// Force Touch Device: USB\VID_05AC&PID_0265&MI_02
@rebcabin
rebcabin / CompositionsOfCompositions.txt
Last active December 14, 2019 01:25
Compositions of compositions in Haskell, pursuant to https://github.com/ekmett/lens/wiki/Derivation
In https://github.com/ekmett/lens/wiki/Derivation, we see some types for
composition of compositions: (.).(.), (.).(.).(.), and so on. Let's prove that
the type of (.).(.) is (a -> b) -> (c -> d -> a) -> c -> d -> b, as stated in
the site. We'll stick with prefix notation, meaning that we want the type of
(.)(.)(.).
Recall the type of composition. This should be intuitive:
(.) :: (b -> c) -> (a -> b) -> a -> c [1]
@kou1okada
kou1okada / CMakeLists.txt
Created November 1, 2016 06:21
Win32 API - ReaderMode Example
cmake_minimum_required(VERSION 2.8)
set(CMAKE_LEGACY_CYGWIN_WIN32 0)
project(ReaderModeExample)
if(MSVC)
add_compile_options("/MP")
endif()
add_executable(ReaderModeExample WIN32
ReaderModeExample.c
const std = @import("std");
const Allocator = std.mem.Allocator;
const workload_size = 1 << 20;
const n_workloads = 4;
const repetition = 4;
const use_async = true;
const use_manual_prefetch = true;
const Cell = extern struct {
@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

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

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;