Skip to content

Instantly share code, notes, and snippets.

View rguiscard's full-sized avatar
💭
thinking

Robert Guiscard rguiscard

💭
thinking
View GitHub Profile

Pi coding agent

Installation

$> curl -fsSL https://pi.dev/install.sh | sh

It add path $HOME/.local/share/pi-node/current/bin/pi.

@rguiscard
rguiscard / cards.cpp
Last active July 28, 2026 05:59
Cards in scrollview (Haiku OS)
#include <Application.h>
#include <Window.h>
#include <View.h>
#include <ScrollView.h>
#include <TextView.h>
#include <String.h>
#include <MenuBar.h>
#include <Menu.h>
#include <MenuItem.h>

HaikuOS on MacBook M5

This is a journal of running HaikuOS on Macbook M5. It should apply generally to all aarch64 platform.

Qemu

Although HaikuOS-aarch64 does work, it is not yet good enough. Therefore, I will use qemu-system-X86_64 to run the x86_64 version of HaikuOS. Even without KVM, it runs reasonally smooth and takes only 10-20% of CPU.

Create disk (qcow2)

@rguiscard
rguiscard / Basic.md
Last active July 31, 2026 02:21
Setting up coding agent on mac

Machine

M5 with 24G RAM

Common tools

  1. Ghostty: with Warmburnout theme.
  2. Homebrew: install via .pkg install; it will ask you to run xcode-select --install which takes a few minutes.
  3. VSCode: still the easiest way to use with kilo via extension; disable telemetry and default copilot AI (search in settings).

Homebrew

  1. Python: installed as dependency of omlx
@rguiscard
rguiscard / README.md
Created October 22, 2024 08:05
Make C library as zig package

It is quite often to include C library in Zig project. If it is a shared library, just link it in build.zig. But if it is not, it can be included as a dependency. Here I use tiny-regex-c as an example.

First, add the c libaray as a dependency.

$ zig fetch --save=tiny_regex_c https://github.com/shahar99s/tiny-regex-c/archive/refs/heads/master.zip

It will show up in the build.zig.zon file. Then include it in build.zig

@rguiscard
rguiscard / add.c
Last active June 5, 2024 02:31
Compile mruby with Cosmopolitan Libc
# Example of mruby with cosmo.
# Compile with `../cosmo/bin/cosmocc -I ../mruby-3.3.0/build/cosmo/include add.c ../mruby-3.3.0/build/cosmo/lib/libmruby.a -o add`
# To run in Linux, do `./add`; to run in Windows, rename it to "add.com" and run under PowerShell `./add.com`.
#include <mruby.h>
#include <mruby/compile.h>
mrb_value add_int_method(mrb_state *mrb, mrb_value self)
{
mrb_int a = 0;
@rguiscard
rguiscard / uConsole.md
Last active August 12, 2024 19:28
uConsole tips and tricks

Installation with new image

Download image from uConsole github. Unzip with p7zip:

$> sudo apt-get install p7zip
$> p7zip -d uConsole_CM4_v1.3g_64bit.img.7z

Find the SD card, probably at /dev/sda. Write image with dd:

Keybase proof

I hereby claim:

  • I am rguiscard on github.
  • I am rguiscard (https://keybase.io/rguiscard) on keybase.
  • I have a public key ASBfhhjEmAWzySI0N0cSfW6VJQcw3LK9yAkFW80zcbozlwo

To claim this, I am signing this object: