Skip to content

Instantly share code, notes, and snippets.

@r8d8
r8d8 / ppg_gauge.md
Last active March 20, 2024 01:45
Power Paraglider (PPG) gauge

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
# Determine the platform
UNAME_S := $(shell uname -s)
CC := clang++
# Folders
SRCDIR := ./
BUILDDIR := build
TARGETDIR := bin
#!/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"
@r8d8
r8d8 / bigint.c
Last active August 8, 2018 06:03
/*
* 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 July 6, 2018 05:10
Lisp in 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 11:53
Serde error while enum flattening
#[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 April 13, 2018 14:41
Golang code style

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
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:

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: