Skip to content

Instantly share code, notes, and snippets.

@r8d8
r8d8 / ppg_gauge.md
Last active Oct 9, 2021
Power Paraglider (PPG) gauge
View ppg_gauge.md

Create electronic gauge capable to collet and display next metrics of PPG engine:

  • Engines RPM (RPM)
  • Engine head temperature (only for air-cooled engines) (Celsius)
  • Total engine hours (hours)
  • Altitude (meters)

Gauge should have 2 modes (Fig. 2):

  • Dual meter
  • Quad meter
View Makefile
# Determine the platform
UNAME_S := $(shell uname -s)
CC := clang++
# Folders
SRCDIR := ./
BUILDDIR := build
TARGETDIR := bin
View fib.sh
#!/bin/bash
echo "How many numbers do you want of Fibonacci series ?"
read total
x=0
y=1
i=2
echo "Fibonacci Series up to $total terms :: "
echo "$x"
echo "$y"
View bigint.c
/*
* Copyright (c) 2007, Cameron Rich
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
@r8d8
r8d8 / lisp.lua
Last active Jul 6, 2018
Lisp in Lua
View lisp.lua
function eval(x)
if type(x)=="table" then
return eval(x[1])(eval(x[2]),eval(x[3]))
else
return x
end
end
function add(x,y) return x+y end
function sub(x,y) return x-y end
@r8d8
r8d8 / flat_error.rs
Created May 10, 2018
Serde error while enum flattening
View flat_error.rs
#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq)]
pub struct KdfParams {
/// Key derivation function
#[serde(flatten)]
pub kdf: Kdf,
/// `Kdf` length for parameters
pub dklen: usize,
/// Cryptographic salt for `Kdf`
@r8d8
r8d8 / go_style_guide.md
Last active Apr 13, 2018
Golang code style
View go_style_guide.md

The code should be read sequentially from beginning to end as a good prose, for code it means grouping logic from main high-level concepts to particular low-level details. In the rest, we simply follow S.O.L.I.D principals.

Recommended way to organize the code:

Length limits (inspired by NASA C Style guide):

  • function body <= 60 loc (to be suitable for single screen)
  • source file <= 600 loc
View cli.yaml
name: emerald
version: "0.20.0"
about: Command-line interface for Emerald platform
args:
- chain:
short: c
help: Sets a chain name
default_value: mainnet
takes_value: true
- version:
View keybase.md

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: