Skip to content

Instantly share code, notes, and snippets.

View rbran's full-sized avatar
🦜

Rubens Brandão rbran

🦜
View GitHub Profile
@rbran
rbran / downcast-rc.rs
Last active October 7, 2025 19:30
if you already have an Rc, downcast is cheap on Rust
use std::any::Any;
use std::collections::HashMap;
use std::rc::Rc;
struct Foo {
id: u8,
name: String,
value: u128,
}
@rbran
rbran / gist:88b8a19050a92d161ea52b78f28fb5f9
Created December 16, 2021 11:37
lapce Arch Linux PKGBUILD
# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Modified: Rubens Brandao <git@rubens.io>
pkgname=lapce
pkgver=0.0.4
pkgrel=1
pkgdesc="Lightning-fast and Powerful Code Editor"
arch=('x86_64')
url="https://github.com/lapce/lapce"
license=('Apache')
depends=('gcc-libs' 'libxcb' 'expat' 'freetype2' 'libxkbcommon')
@rbran
rbran / create-my-signed-boot-cert.sh
Created December 6, 2021 17:54
My UEFI signed Kernel stub
#!/bin/bash
# Copyright (c) 2015 by Roderick W. Smith
# Licensed under the terms of the GPL v3
NAME=$(cat /etc/hostname)
if [ -z "$NAME" ]; then
echo -n "Enter a Common Name to embed in the keys: "
read NAME

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@rbran
rbran / bench.rs
Created October 8, 2015 18:57
Simple Bench to test dynamic and static dispatching on Rust.
use std::env;
use std::io;
use std::option::Option;
struct StructTest {
any_value: i32
}