Skip to content

Instantly share code, notes, and snippets.

View BorisKotlyarov's full-sized avatar
:octocat:

Boris Kotlyarov BorisKotlyarov

:octocat:
View GitHub Profile
@BorisKotlyarov
BorisKotlyarov / postgresql_recursive.sql
Created October 23, 2019 10:21 — forked from dankrause/postgresql_recursive.sql
An example of creating a recursive postgresql query to generate data about parent-child relationships within a single table.
CREATE TABLE test
(
id INTEGER,
parent INTEGER
);
INSERT INTO test (id, parent) VALUES
(1, NULL),
(2, 1),
@BorisKotlyarov
BorisKotlyarov / EOS.md
Last active January 16, 2019 09:56
Eosio Reference

Eosio reference

#!/usr/bin/env bash
cd ~/eos/contracts/user_contract
eosio-cpp -o user_contract.wasm user_contract.cpp --abigen
cd ~/eos/contracts/marketplace
eosio-cpp -o marketplace.wasm marketplace.cpp --abigen
cd ~
cleos wallet unlock --password PW5HrBPdJkwuSxXmUMMCofPsouiTJGwq9swJsp5Psdvxvv5YvC8QB
cleos create account eosio eosio.msig __PUBLIC_KEY__ __PUBLIC_KEY__
function base64Encode(data){
return Buffer.from(data.toString()).toString('base64');
}
function base64Decode(data){
return Buffer.from(data, 'base64').toString('ascii');
}
module.exports = {
base64Encode,
String.prototype.toCapitalize = function () {
let arr = this.toLowerCase().split(" ");
arr.forEach((item, index) => {
arr[index] = item[0].toUpperCase() + item.substr(1);
});
return arr.join(" ");
}
@BorisKotlyarov
BorisKotlyarov / README.md
Last active February 26, 2017 14:24
Example history router

Example

	function consoleWrite(url, route){
		console.log(`%c ${url}:`, 'color: green;', route);
	}

	window.addEventListener('load', ()=>{
		let router = new Router(consoleWrite);

 router.addRoute('/pages:page.html',consoleWrite);
@BorisKotlyarov
BorisKotlyarov / index.html
Last active November 27, 2016 16:45
Preview uploaded image and converting it into a base64 string
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Image to Base64</title>
</head>
<body>
<style>
body {