Skip to content

Instantly share code, notes, and snippets.

View siman's full-sized avatar
🏠
Working from home

Alex Siman siman

🏠
Working from home
View GitHub Profile
@siman
siman / MyAccountProvider.tsx
Created April 28, 2019 19:54
My account provider for Joystream UI
import React, { useReducer, createContext, useContext, useEffect } from 'react';
import store from 'store';
export const MY_ADDRESS = 'joy.myAddress';
function readMyAddress (): string | undefined {
const myAddress: string | undefined = store.get(MY_ADDRESS);
console.log('Read my address from the local storage:', myAddress);
return myAddress;
}
@siman
siman / substrate-blogs.rs
Created March 24, 2019 08:25
Separate fields (name, title, body, tabs)
#![cfg_attr(not(feature = "std"), no_std)]
use rstd::prelude::*;
use parity_codec::Codec;
use parity_codec_derive::{Encode, Decode};
use srml_support::{StorageMap, StorageValue, dispatch, decl_module, decl_storage, decl_event, ensure, Parameter};
use srml_support::traits::{Currency};
use runtime_primitives::traits::{Zero, SimpleArithmetic, As, Member, MaybeSerializeDebug};
use system::{self, ensure_signed};
use crate::governance::{GovernanceCurrency, BalanceOf };
@siman
siman / visual-code-user-settings.json
Last active June 30, 2019 09:49
Visual Studio Code with Rust syntax. You need to install "dark-plus-syntax" theme before.
{
"window.zoomLevel": 1,
"gitlens.settings.mode": "advanced",
"eslint.enable": false,
"files.autoSave": "onFocusChange",
"files.associations": {
"*.css": "scss"
},
"editor.wordWrap": "on",
"editor.renderWhitespace": "boundary",

Keybase proof

I hereby claim:

  • I am siman on github.
  • I am siman (https://keybase.io/siman) on keybase.
  • I have a public key ASC4Sc6unZDjkw96TnP-XHlxEi4f8L2CCswkyoZ0JfIg9wo

To claim this, I am signing this object:

@siman
siman / config.toml
Created October 2, 2018 10:09
tendermint config.toml
# This is a TOML config file.
# For more information, see https://github.com/toml-lang/toml
##### main base config options #####
# TCP or UNIX socket address of the ABCI application,
# or the name of an ABCI application compiled in with the Tendermint binary
proxy_app = "tcp://127.0.0.1:26658"
# A custom human readable name for this node
@siman
siman / image-proxy.conf
Created September 24, 2018 21:08 — forked from tmaiaroto/image-proxy.conf
Nginx Image Filter Resize Proxy Service
# Feel free to change this path of course (and keys_zone value as well, but also change the usage of it below).
proxy_cache_path /var/www/cache/resized levels=1:2 keys_zone=resizedimages:10m max_size=1G;
# Gzip was on in another conf file of mine...You may need to uncomment the next line.
#gzip on;
gzip_disable msie6;
gzip_static on;
gzip_comp_level 4;
gzip_proxied any;
# Again, be careful that you aren't overwriting some other setting from another config's http {} section.
@siman
siman / preview-card-facebook-open-graph.html
Created September 18, 2018 11:21
preview-card-facebook-open-graph.html
<head>
<!-- Open Graph tags for sharing on Facebook: -->
<meta property="og:site_name" content="Egeon">
<meta property="og:image" content="http://egeon.io/img/preview-card.jpg">
<meta property="og:title" content="Egeon - decentralized rating and reviews for ICO listing">
<meta property="og:description" content="Egeon is a community-driven marketplace for distributed due diligence, token sale and governance of blockchain projects.">
</head>
@siman
siman / preview-card-twitter-tags.html
Created September 18, 2018 11:21
preview-card-twitter-tags.html
<head>
<!-- Card tags for sharing on Twiter: -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@Egeon" />
<meta name="twitter:image" content="http://egeon.io/img/preview-card.jpg" />
<meta name="twitter:title" content="Egeon - decentralized rating and reviews for ICO listing" />
<meta name="twitter:description" content="Egeon is a community-driven marketplace for distributed due diligence, token sale and governance of blockchain projects." />
</head>
@siman
siman / index.js
Created February 10, 2018 00:08 — forked from abrkn/index.js
kraken-minimal-trader
#!/usr/bin/env node
const assert = require('assert');
const { delay } = require('bluebird');
const BigNumber = require('bignumber.js');
const kraken = require('./kraken');
const {
fetchMyOpenOrders,
fetchOrderBook,
placeOrder,
pragma solidity ^0.4.16;
contract ExternalTx {
enum Currency { BTC, LTC, DASH, ZEC, WAVES, USD, EUR }
// currency_code => (tx_hash => tokens)
mapping (uint8 => mapping (bytes32 => uint256) ) public txs;
function externalSales(