Skip to content

Instantly share code, notes, and snippets.

View telamon's full-sized avatar
🥲
probing for lost signals

Tony Ivanov telamon

🥲
probing for lost signals
View GitHub Profile
# API Design
PUT /$/bee/index
^ ^ ^^^^^ <-- hyperbee namespace
| |---- hyperbee special-path
|---- SPECIAL META charactter for hyper-fetch.
[
{ OPERATION1 },
{ OPERATION2 },

For a custom encoding using URL fragment-safe characters, you can go beyond Base64.
Considering alphanumeric characters (A-Z, a-z, 0-9), which give you 62 characters,
and adding safe special characters like:

-_.~!$&'()*+,;=:@?/#[]

(which are 22 in total), you can potentially reach a base count of around 84 (62 + 22).

This would be a custom base-84 encoding, utilizing these URL-safe characters to maximize space efficiency.

@telamon
telamon / tensor_cheatsheet.md
Created October 5, 2023 22:13
beginner pytorch tensor-cheatsheet.

Pytorch Tensor Cheatsheet

1. Initialization

  • Scalar (0D tensor):
    x = torch.tensor(42)
    # Shape: []
@telamon
telamon / emojisearch.js
Created October 9, 2022 20:19
Emoji search-n-type picker
import { readFileSync } from 'node:fs'
import { pack, unpack } from 'msgpackr'
// Load tag->emo list
let a
try {
a = JSON.parse(readFileSync('./emojis.json'))
} catch (err) {
console.error(err.message)
console.log('do you have the input file?')
@telamon
telamon / sharescreen.sh
Last active October 2, 2023 02:45
Wayland screenshare script via wf-recorder and v4l2loopback
#!/bin/bash
# Preliminary steps (void linux):
# sudo xbps-install -Su v4l2loopback wf-recorder
# (don't forget to reboot if new Kernel version was upgraded)
#
# Too lazy to autodetect active monitor resolution
WIDTH=2560
HEIGHT=1440

Failing test:

test('encoding fault', t => {
  t.plan(2)
  const f1 = hypercore(ram)

  const dummyExt = {
    encoding: {
      encode: () => t.ok('encoder was invoked'), // encoder is not invoked.
      decode: () => t.ok('decode was invoked')
@telamon
telamon / README.md
Last active July 31, 2019 22:53
Replication proposal draft
@telamon
telamon / README.md
Last active November 29, 2018 12:14
Instant kibana

kibup (Kibana up)

Launches a local kibana instance that connects to an Elastic instance specified by url

Installation:

Download kibup script and make it executable chmod +x kibup

Usage:

@telamon
telamon / simple_test.ino
Created February 1, 2018 00:07
TMC2130 driver debugging
/**
* Author Teemu Mäntykallio
* Initializes the library and turns the motor in alternating directions.
*/
#define EN_PIN 48 // Nano v3: 16 Mega: 38 //enable (CFG6)
#define DIR_PIN 16 // 19 55 //direction
#define STEP_PIN 17 // 18 54 //step
#define CS_PIN 31 // 17 64 //chip select
#define MOSI_PIN 51
@telamon
telamon / init.vim
Created August 16, 2017 13:25
My amazing Neovim configuration.
" Tony's Settings
" Usage:
" Download and install nvim, then install 'dein' the vim-package manager.
" During installation of dein it will output a sample configuration, take the
" two lines that `set runtimepath=PATH` and `dein#begin(PATH)` and replace the
" ones in this file online 14 and 17. Restart nvim and Happy Vimming!
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved