This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config --global commit.gpgsign true | |
| git config --global user.signingKey 13D9C694 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "constant": false, | |
| "inputs": [], | |
| "name": "withdraw", | |
| "outputs": [], | |
| "payable": false, | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const curried = Symbol('curried'); | |
| function isCurried(fn) { | |
| return fn[curried] === true; | |
| } | |
| function curry(fn, stored = []) { | |
| if (isCurried(fn)) { | |
| return fn(...stored); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function up(doc, db) { | |
| return { | |
| $set: { | |
| newProp: true, | |
| }, | |
| $unset: { | |
| oldProp: 1, | |
| }, | |
| }; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const BN = require("bn.js"); | |
| const {fromWei} = require('ethjs-unit'); | |
| const bn = (value) => new BN(value, 10); | |
| const X = bn(1000); | |
| const WEI = new BN(1); | |
| const KWEI = WEI.mul(X); | |
| const MWEI = KWEI.mul(X); | |
| const GWEI = MWEI.mul(X); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Node.js version | |
| function toLeaBuffer(msg) { | |
| const msgBuf = Buffer.from(msg, 'utf8'); | |
| const sizeBuf = Buffer.allocUnsafe(8); | |
| sizeBuf.writeBigUInt64BE(BigInt(msgBuf.length)); | |
| return Buffer.concat([sizeBuf, msgBuf]); | |
| } | |
| // Browser version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const currencyType = Type.string | |
| .enum([ | |
| 'BTC', | |
| 'ETH', | |
| 'USD', | |
| ]); | |
| const numberType = Type.number; | |
| class Exchange { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // В данный момент мы имеем следующий код. Этот код пронизан зависимостями и | |
| // связями с другими элементами, что делает его неделимы, уникальным и | |
| // не изменяемым. | |
| export function logIn() { | |
| return dispatch => { | |
| // (!) Ссылка на глобальную область видимости window. | |
| // (!) Связывание интерфейсов Web3 и Redux. | |
| window.web3.eth.getAccounts((err, accounts) => { | |
| const acc = accounts[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.0; | |
| import './utils/safe-math.sol'; | |
| contract Contract { | |
| // Extension --------------------------------------------------------------- | |
| using SafeMath for uint; | |
| // Types ------------------------------------------------------------------- | |
| // Constants --------------------------------------------------------------- | |
| // State ------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cloud-config | |
| users: | |
| - name: nodejs | |
| gecos: Nodejs application | |
| sudo: None | |
| lock_passwd: true | |
| # ssh_authorized_keys: | |
| # - Add your ssh keys here |