Skip to content

Instantly share code, notes, and snippets.

View SkymanOne's full-sized avatar
🎯
Focusing

Gherman SkymanOne

🎯
Focusing
View GitHub Profile
@SkymanOne
SkymanOne / Workshop.sh
Last active October 24, 2023 16:14
Eth Workshop
cast send <contract> "store(uint256 num)" "1" --unlocked --from 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
cast call <contract> "retrieve()"

Keybase proof

I hereby claim:

  • I am skymanone on github.
  • I am skymanone (https://keybase.io/skymanone) on keybase.
  • I have a public key ASBQRqppoX6tTqEnj8bkHUYd4bM1KtP6RfwKw-H_J5CuIwo

To claim this, I am signing this object:

@SkymanOne
SkymanOne / sig.rs
Last active August 2, 2022 00:43
working signature
use std::fmt::format;
use parity_scale_codec::{ Encode, Decode};
use sp_core::{H256, H512, Pair};
use sp_core::sr25519::{Signature};
fn main() {
let print_string = generate("//Alice", Vote::Yes);
println!("Alice - Yes - {}", fm(print_string));
@SkymanOne
SkymanOne / merkle_tree.rs
Last active July 28, 2022 23:01
Simple Merkle Tree
//! This is minimal Merkle tree implementation with proof checking
use std::{
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
};
fn main() {
let s = "";
let h = calculate_merkle_root("Trust me, bro!");
use parity_scale_codec::{ Encode, Decode};
use sp_core::{H256, H512, Pair};
type Salt = u8;
const SALT: Salt = 5u8;
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone)]
pub struct BasicExtrinsic {
operation: Operation,
@SkymanOne
SkymanOne / aes-modes.rs
Last active July 17, 2022 16:48
Solution to Polkadot Academy extra challenge on Sunday
//! In Module 1, we discussed Block ciphers like AES. Block ciphers have a fixed length input.
//! Real wold data that we wish to encrypt _may_ be exactly the right length, but is probably not.
//! When your data is too short, you can simply pad it up to the correct length.
//! When your data is too long, you have some options.
//!
//! In this exercise, we will explore a few of the common ways that large pieces of data can be broken
//! up and combined in order to encrypt it with a fixed-length block cipher.
//!
//! WARNING: ECB MODE IS NOT SECURE.
//! Seriously, ECB is NOT secure. Don't use it irl. We are implementing it here to understand _why_ it
@SkymanOne
SkymanOne / b_tree.rs
Last active February 20, 2022 16:17
Basic binary tree in rust
//alias a complex type for cleaner code
pub type Link = Option<Box<Node>>;
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct Node {
value: i8,
left_node: Link,
right_node: Link,
}
impl Node {

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@SkymanOne
SkymanOne / MultithreadExample.cs
Created August 26, 2021 21:12
Mini multithread application example
using System;
using System.Threading;
namespace threadTest
{
class Program
{
static void Main(string[] args)
{
//Let's create a dedicated thread to demmonstarte that the whole process can be done inside another thread
@SkymanOne
SkymanOne / Launch Xamarin.iOS app
Last active September 18, 2020 22:04
VS Code Task config to launch iOS app in Xamarin.Forms project
{
//just copy paste in .vscode/tasks.json
//run by pressing cmd+shift+p
"version": "2.0.0",
"tasks": [
{
"label": "build",
"group": "build",
"command": "msbuild",
"type": "process",