Skip to content

Instantly share code, notes, and snippets.

Workin' on Rust Stuff

Lokathor Lokathor

Workin' on Rust Stuff
View GitHub Profile
View lokathor.nanorc
## An improved version of the "official" rust highlight file, Licensed GPL v3
syntax "rust" "\.rs"
comment "//"
# The order of these colorations is significant.
# Matches later down will re-color earlier matches.
# Thus, we place the most general matches first and allow them to be overriden later if necessary.
# Function definitions
View toss-a-coin-to-your-loka.txt
🎵 When a humble Mem
graced a ride along
with Loka of Thoria
along came this song.
From when the Glider fought
a foreign-tongued repo
its unsynch'd globals
the ey pi ai's credo.

Cargo Crev Quickstart

You should consider using cargo-crev more often.

  • Installation: You need to obtain OpenSLL, and then cargo install cargo-crev
  • (All commands from here are for cargo-crev 0.13.0; command usage may change in the future)
  • Make Your ID: cargo crev id new --url [repo_url]
    • This prompts for a password that will protect the ID.
    • This is the cryptographic style "you can't ever recover this" type of password.
    • Keep it secret and keep it safe.
Lokathor /
Last active Dec 8, 2019
Blog post about how to build `cfg_if` style macro.

Diving in to cfg_if!

How exactly does the cfg_if! macro do its thing?

First of all what is the cfg_if! macro? It's a macro to help you pick a set of code based on compile-time configutation. There is a sample usage on the docs page:


Here are the steps to setup mgba as well as the development tools that you'll need to build GBA roms on your Raspberry Pi. I did this on a Pi4, but it should work on a Pi3 or even a Pi2 just as well.

  • un-comment the sources repo in /etc/apt/sources.list using your editor of choice (requires root of course).

  • sudo apt-get update to get fresh sources info

  • sudo apt build-dep mgba-qt to install all the dependencies of the Qt

View right_hand_pokemon.txt
> Rocket Leader Geovani's got troops on the water
> Thirty-two thousand troops in Fuchsia harbor
> Thirty-two thousand troops in Fuchsia harbor
> When they surround our troops (They surround our troops)
> When they surround our troops
As a kid in the Orange Islands I wished for a war
I knew that I was poor
I knew it was the only way to
> Rise up

Earthdawn Game

blank character sheet

General Rules

  • The rules will default to the Earthdawn 4e rules.
  • If a rule is missing from 4e but present in a previous edition then we might use the rule from the previous edition (if it's sane and such).

Specific House Rules

View USB,2-axis 8-button gamepad .cfg
input_device = "USB,2-axis 8-button gamepad "
input_driver = "udev"
input_a_btn = "0"
input_b_btn = "1"
input_x_btn = "2"
input_y_btn = "3"
input_l_btn = "4"
input_r_btn = "5"
input_select_btn = "6"
  • Feature Name: platform_channel_section
  • Start Date: 2019-02-27
  • RFC PR: (leave this empty)
  • Rust Issue: (leave this empty)


We add a whole new section to the channels list for Platform channels. It contains one channel for each major target platform (Win, Mac, etc).

//! Operations which rely on use of `std`. Not included by default.
use std::sync::{
atomic::{AtomicPtr, Ordering},
Mutex, MutexGuard,
/// Uses the system clock to get an arbitrary `u64` value.
pub fn u64_from_time() -> u64 {
use std::time::{SystemTime, UNIX_EPOCH};