Skip to content

Instantly share code, notes, and snippets.

@goastoman
goastoman / account.js
Created January 20, 2018 07:11
Moneybox contract Tutorial. Not for production.
// Creates secret key and balance for test net. Outputs account.json.
const fs = require('fs');
const Web3 = require('web3');
const crypto = require('crypto');
const {run} = require('./lib/utils.js');
const prompt = require('./lib/prompt.js');
async function main() {
@goastoman
goastoman / AYN.sol
Created January 19, 2018 11:18
Simple ERC20 token for deploying
pragma solidity ^0.4.11;
import "./ERC20Standard.sol";
contract NewToken is ERC20Standard {
function NewToken() {
totalSupply = 1000000;
name = "All you need coin";
decimals = 6;
symbol = "AYN";
@goastoman
goastoman / gist:b62f822b18f9af4d773cfad8ab7a6d9d
Last active January 16, 2018 07:47
Площадь треугольника по трем сторонам с проверками
export const getTriangleArea = (a, b, c) => {
if (a > 0 && b > 0 && c > 0) {
const p = (a + b + c) / 2;
console.log(p);
const area = Math.sqrt(p * (p - a) * (p - b) * (p - c));
console.log(area);
@goastoman
goastoman / SQLrequest.sql
Last active January 20, 2018 07:15
Simple SQL-request
CREATE TABLE customers (
id INTEGER PRIMARY KEY,
CustomerId INTEGER,
RegistrationDateTime DATE,
Name TEXT);
INSERT INTO customers (CustomerId, RegistrationDateTime, Name)
VALUES (1, "2017-11-25", "Bulat");
INSERT INTO customers (CustomerId, RegistrationDateTime, Name)
VALUES (2, "2017-12-15", "Alina");
@goastoman
goastoman / SumOfTheDigits.js
Last active January 20, 2018 07:13
Autoresponder
require(Modules.IVR);
let extState;
function initIVR() {
extState = new IVRState("extension", {
type: "inputfixed",
inputLength: 2,
prompt: {
say: "Hello, World. To continue, enter two digits.",