Skip to content

Instantly share code, notes, and snippets.

Working from home

Alex Siman siman

Working from home
View GitHub Profile
siman / HelloOrbitDB.tsx
Last active Jul 23, 2020
Hello world example for OrbitDB
View HelloOrbitDB.tsx
import { useEffect, useState } from 'react'
const IpfsClient = require('ipfs-http-client')
const OrbitDB = require('orbit-db')
const ipfs = IpfsClient('/ip4/')
// Your identity id can be retrieved with:
// console.log(
use rstd::prelude::*;
use support::{decl_module, decl_storage, decl_event, StorageValue, StorageMap, ensure, dispatch::Result, Parameter};
use parity_codec::{Encode, Decode, Codec};
use runtime_primitives::traits::{As, Member, SimpleArithmetic, MaybeDebug, MaybeSerializeDebug};
use rstd::collections::btree_map::BTreeMap;
use {timestamp};
use system::{self, ensure_signed};
pub const MIN_SPACE_OWNERS: u16 = 1;
pub const MAX_SPACE_OWNERS: u16 = u16::MAX;
siman / PropertyTypes.ts
Created Dec 12, 2019
Property types for Joystream versioned store codegen
View PropertyTypes.ts
abstract class BaseProperty {
public type: string;
public name: string;
public description?: string;
public required?: boolean = false;
export class PrimitiveProperty extends BaseProperty {}
export class VecProperty extends BaseProperty {
siman /
Last active Jan 27, 2020
Useful Linux commands for server admins (Ubuntu)

Useful Linux Commands for Admins

Restart Subsocial docker container

docker container restart subsocial_node_alice_1

Process manager + shows CPU and RAM usage


View substrate-playground.ts
import { Substrate } from "../cli/substrate";
import { arrayToOneLineString, prettyClass, prettyEntity } from '../cli/printers';
import { AddClassSchemaInputType } from '../types/AddClassSchemaTypes';
const classId = 1
const entityId = 1
const schemaId = 0
// tslint:disable-next-line:max-func-body-length
async function main() {
View simple-pluralize.tsx
function pluralize(count: number | BN, singluarText: string, plularText?: string) {
count = typeof count !== 'number' ? count.toNumber() : count;
const plural = () => !plularText ? singluarText + 's' : singluarText;
const text = count === 1 ? singluarText : plural()
return <><b>{count}</b> {text}</>
siman /
Created Sep 17, 2019
Web3 Foundation tasks for blockchain hackathon. Kyiv, Sep 21-22, 2019.

Вознаграждение от Web3 Foundation в размере $500 получит команд(а/ы), которая предложит качественное решение на блокчейне фреймворке Substrate или же, если это решение связано с инфраструктурой Polkadot Network. В качестве примеров, могут быть проекты на такую тему:

  • Альтернативные реализации тех модулей (SRML), которые уже идут в составе Substrate. Например:
    • Упрощенный модуль для балансов "balances" без locking, vesting, etc.
    • Упрощенный модуль для голосования "voting" с квадратическим голосованием.
    • Альтернативная реализация модуля "treasury"
    • и т.д.
View joystream-podcast-episode-schema.json
"name": "PodcastEpisode",
"description": "Joystream class schema for a podcast episode",
"properties": [
"name": "title",
"type": "Text",
"required": true,
"maxTextLength": 100
siman / joystream-new-class.schema.json
Last active Sep 10, 2019
Joystream class JSON schema with example
View joystream-new-class.schema.json
"$schema": "",
"$id": "TODO: An URL of this schema. Ideally at Example:",
"title": "JoystreamNewClass",
"description": "JSON schema to describe a new class for Joystream network",
"type": "object",
"additionalProperties": false,
"required": [
// Copyright 2019 Jsgenesis.
// This is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see <>.
You can’t perform that action at this time.