Skip to content

Instantly share code, notes, and snippets.

Nicolas uucidl

Block or report user

Report or block uucidl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Bitwise Day 62: Indexed Arrays

Per worked 20h since Day 61.

How do we get a good story for dynamic arrays? What we called stretchy bufs (buf_... API)

Added many new intrinsics to gen_intrinsic:

  • apush, kadd, kdget, kdel
  • hget, hdel
uucidl /
Last active Jan 22, 2019

Example devices:

  • Inkbird IBT-2X


  • @ConnectTimeout: 60 seconds

  • @BatteryPollingInterval: 5 minutes

The iBBQ is a Bluetooth LE Gatt Device

uucidl / traverse_children.ion
Last active Dec 9, 2018
Traversing Hierarchies
View traverse_children.ion
// Depth first traversal algorithm.
// (credit to Alexander Stepanov in Elements Of Programming)
// One of the benefits is that the visitor can implement pre or post traversal algorithms, and combine them in one single piece.
// @generic in T, the node value type
func traverse_children_recursively(tree_root: T*, step_visitor: func(step: TraversalStep, node: T*))
step_visitor(TraversalStep_PRE, tree_root);
uucidl / test_metal_with_sdl2.c
Created Nov 11, 2018
Testing metal on my macs. My dear Mac Mini does not support it
View test_metal_with_sdl2.c
#include "SDL2.framework/Headers/SDL.h"
#define sdl2_guard(__expr) \
if ((__expr) != 0) { \
fprintf(stderr, "SDL Error: '%s'\n", SDL_GetError()); \
assert(0); \
#include <assert.h>
uucidl /
Last active Oct 29, 2018
Rokusa (Pure)

Some useful code written in ion

uucidl /
Last active Oct 24, 2018
Octave Tree


A tree can be produced by counting the number of trailing zeros from an input integer index.

This count ('c') of trailing zeros (or position of the lowest bit) comes back every 2^c sample, i.e. corresponds to a frequency of 2^-c

Furthermore every sample corresponds with one and only one octave.

uucidl /
Created Jan 22, 2018
little program to use if you're canoscan lide30 scanner says "device not configured"
#!/usr/bin/env bash
export C_INCLUDE_PATH=/usr/local/include/libusb-1.0
export LIBRARY_PATH=/usr/local/lib
(O=canoscan ; cc canoscan_unit.c -o "${O}" -lusb-1.0 && printf "PROGRAM\t%s\n" "${O}")
uucidl / atan_approx.c
Last active Jan 4, 2018
View atan_approx.c
// Atan approximation
#include <math.h>
#include <stdio.h>
double atan_approx(double z)
double m = z<0? -1.0:1.0;
z *= m;

Techniques of persuasion.

Has had a bad rap throughout ages. Appears necessary in democratic societies. Preserved under authoritarian systems for justice and theology, and for elite groups. In western republic democracies, mainly practiced by professional politicians (elective nobility) and lawyers. Porosity between the two groups.

More and more essential in the companies that want to emphasize group problem solving and collaboration. Practiced without knowing it, in a dry style, by engineers via their communications and documentations.


  • Magic/Mysterium. In classical times it was clear that it takes time to develop know-how. Practice. Initiation. Hence roles of schools as safe space for learning and practice.
  • Eloquence
You can’t perform that action at this time.