Skip to content

Instantly share code, notes, and snippets.

@vikiival
vikiival / TodoContract.sol
Last active January 5, 2019 09:43
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.2+commit.1df8f40c.js&optimize=false&gist=
pragma solidity >=0.4.22 <0.6.0;
contract SimpleContract {
struct TodoItem {
uint256 id;
string name;
bool completed;
}
struct User {
#include <stdio.h>
int main() {
int id;
__asm__(
"mov $0x02000004, %%eax;"
"syscall;\n"
: "=a"(id)
);
@vikiival
vikiival / docker-compose-test-net.yaml
Created June 24, 2020 11:11
Add cli to Hyperledger test network
cli:
container_name: cli
image: hyperledger/fabric-tools:$IMAGE_TAG
tty: true
stdin_open: true
environment:
- GOPATH=/opt/gopath
- CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
- FABRIC_LOGGING_SPEC=INFO
#- FABRIC_LOGGING_SPEC=DEBUG
alexcvzz.vscode-sqlite
andys8.jest-snippets
apollographql.vscode-apollo
austincummings.razor-plus
bobsparadox.seti-black
BriteSnow.vscode-toggle-quotes
christian-kohler.npm-intellisense
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer
dbaeumer.vscode-eslint
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew cask install iterm2
# update iterm2 settings -> colors, keep directory open new shell, keyboard shortcuts
brew install bash # latest version of bash
# set brew bash as default shell
brew cask install visual-studio-code
# update vscode settings
# install vscode extensions
@vikiival
vikiival / ksm.py
Created December 3, 2020 17:32
Price of Kusama (KSM) for last 30 days
from pycoingecko import CoinGeckoAPI
import datetime
from statistics import median, mean
cg = CoinGeckoAPI()
def main():
numdays = 30
base = datetime.datetime.today()
date_list = [base - datetime.timedelta(days=x) for x in range(numdays)]
fn_format = lambda x: x.strftime("%d-%m-%Y")
@vikiival
vikiival / fetch.sh
Last active February 3, 2021 11:38
Fetching RMRK
#!/bin/bash
i=5438000
while [ $i -le 6010749 ]
do
yarn fetch --ws 'wss://kusama-rpc.polkadot.io' --from $i --to $((i+999))
let "i+=1000"
done
@vikiival
vikiival / Epoch.sol
Last active March 17, 2021 09:31
NFT crashcourse for FIIT STU
// SPDX-License-Identifier: MIT
// Author Viktor Valastin (github: @vikiival)
pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/token/ERC721/ERC721.sol';
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/access/Ownable.sol';
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/utils/Counters.sol';
Objekt Aro Slad Med Bez Klas Tvrd Bel Bar1 Bar2 Bar3 Sup Str
B5 6.480 6.660 4.560 2.200 2.910 3.470 4.720 5.585 5.735 5.985 4.260 3.250
C4 5.750 6.090 3.810 2.320 4.030 3.770 4.170 5.730 5.745 5.325 3.820 3.380
B2 3.940 4.120 2.440 3.630 5.770 5.390 4.770 6.665 5.105 4.595 3.500 3.030
D5 6.600 6.120 4.440 1.930 3.310 4.460 4.860 5.160 5.740 6.565 2.120 3.940
D4 5.680 5.980 3.800 2.120 3.850 4.140 5.030 5.635 5.220 5.480 2.380 5.160
E2 4.740 4.660 2.880 2.940 5.650 5.770 5.310 5.940 5.270 5.890 1.750 3.640
B5 6.310 6.130 4.780 1.940 2.700 3.260 5.070 5.710 5.370 6.365 3.650 4.550
C5 6.200 6.020 4.650 1.780 3.120 3.740 5.250 5.655 5.475 5.960 2.510 3.800
C2 3.790 3.880 2.310 3.520 6.240 5.730 5.390 6.300 5.135 5.230 2.010 4.110