Skip to content

Instantly share code, notes, and snippets.

View dbezrukov's full-sized avatar
🎯
Focusing

Dmitry Bezrukov dbezrukov

🎯
Focusing
  • Customuse
  • London
View GitHub Profile
@dbezrukov
dbezrukov / lzuint8array.js
Created March 24, 2022 16:31 — forked from JobLeonard/lzuint8array.js
Uint8Array to LZ-string and back
const LZuint8Array = (function () {
/*
basic ranges of printable UTF16 values (as found in LZ-string):
[32, 127), [160, 55296), [63744, 65536)
We also have filter out string characters like:
" (34)
' (39)
` (44)
(Forward tick is safe: ´ (96))
So:
@dbezrukov
dbezrukov / panel.scss
Created July 22, 2019 10:40
Composing styles with scss
@import '~terriajs-variables';
.panel {
composes: list-reset from 'terriajs/lib/Sass/common/_base.scss';
composes: clearfix from 'terriajs/lib/Sass/common/_base.scss';
composes: sm-show from 'terriajs/lib/Sass/common/_base.scss';
}
.panel-btn {
composes: btn from 'terriajs/lib/Sass/common/_buttons.scss';
const Web3 = require('web3');
const solc = require('solc');
// For localhost
const web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
let source = 'contract Hello{ string h = "hello"; function g() constant returns(string){ return h; } }';
let helloCompiled = solc.compile(source, 1).contracts[':Hello'];
You may need to unlock the address which is going to deploy the contract (Make sure there is enough funds on this address):