Skip to content

Instantly share code, notes, and snippets.

View shekohex's full-sized avatar
🦀
building a better world

shekohex

🦀
building a better world
View GitHub Profile
@shekohex
shekohex / Cargo.toml
Created July 14, 2021 22:50
The Code for Building Secure E2EE Chat Apps in Rust and Flutter (Part 1)
[package]
name = "chitchat"
version = "0.1.0"
edition = "2018"
[dependencies]
x25519-dalek = "^1.1"
rand = { version = "0.7", default-features = false, features = ["getrandom"] }
chacha20poly1305 = { version = "0.7", default-features = false, features = ["std", "chacha20"] }
/// For https://github.com/mitsuhiko/redis-rs/issues/509
///
/// redis crate v0.20
/// tokio crate v1
/// tokio-stream crate v0.1
use std::sync::Arc;
use future::Either;
use futures::future;
@shekohex
shekohex / evmToEdg.ts
Created April 1, 2021 17:38
Convert EVM address to EDG address
import {
blake2AsU8a,
encodeAddress,
} from "https://esm.sh/@polkadot/util-crypto";
import {
hexToU8a,
stringToU8a,
u8aConcat,
} from "https://esm.sh/@polkadot/util";
@shekohex
shekohex / main.dart
Created March 11, 2021 17:57
Color To Hex
import 'dart:ui';
extension ColorHex on Color {
String toHex({bool withPrefix = false}) {
final hex = value.toRadixString(16);
return withPrefix ? '0x$hex' : hex;
}
}
void main() {

sunshine identity proof

I hereby claim:

  • I am shekohex on github.
  • I am 7 on the substrate chain with genesis hash mJ48g+smjh1YYeMg7oEE1r9jrNHrzPp2BSPVrKQlP1cE.
  • I have a public key 5ECTNZbEXmUV3dNG4S1tjGUDh6zQTe12GQQTtNcX6ecFfdLG valid at block with hash m/Mtlb2KiYNjT4vSsZwP13Dk7ylEyTiW+nmiqR/7SucU.

To claim this, I am signing this object:

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

use std::io::BufWriter;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::Write;
use std::{fs::File, io, sync::mpsc};
pub struct Chunk {
data: Vec<u8>,
start_offset: u64,
}
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:

substrate identity proof

I hereby claim:

  • I am shekohex on github.
  • I am 0 on the substrate chain with genesis hash mmbCyYp+spvLi/tHZd+NcaUuIqFEKcPSllOiZ2S/542A.
  • I have a public key 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY valid at block with hash m+lbpBuAxeMMLRt8k6NkB4bssZCqtu0axB/dQTfNZD8k.

To claim this, I am signing this object:

@shekohex
shekohex / rustfmt.toml
Created August 11, 2019 16:08
Rust Format Configuration for my projects
max_width = 80
tab_spaces = 4
fn_single_line = true
match_block_trailing_comma = true
normalize_comments = true
wrap_comments = true
merge_imports = true
reorder_impl_items = true
use_field_init_shorthand = true
use_try_shorthand = true