Skip to content

Instantly share code, notes, and snippets.

@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.",
@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 / 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 / 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 / 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 / geth
Created January 21, 2018 06:03
Setting Up geth console
brew update
brew upgrade
brew tap ethereum/ethereum
brew install cpp-ethereum
brew linkapps cpp-ethereum
//get the way to binar
export PATH=*YOURWAYTOBIN*:$PATH
@goastoman
goastoman / SCT.sol
Created January 22, 2018 10:21
Simple Coin Token
pragma solidity ^0.4.18;
contract Ownable {
address public owner;
function Ownable() public {
owner = msg.sender;
}
@goastoman
goastoman / list.php
Created January 27, 2018 09:06
AmoCRM
$subdomain = 'ХХХ.com'; #Наш аккаунт - поддомен
/*
Подключаемся
*/
$link='https://'.$subdomain.'.amocrm.ru/private/api/v2/json/leads/list';
$curl=curl_init();
0x4f207eaE259c0353Adbd0d50e541EA1eC8C71D9c
@goastoman
goastoman / preico
Created February 16, 2018 10:27
preico
pragma solidity ^0.4.18;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {