Skip to content

Instantly share code, notes, and snippets.

View kricha's full-sized avatar
🏠
Working from home

Oleksii kricha

🏠
Working from home
View GitHub Profile
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
import Web3 from 'web3';
import { TransactionConfig } from 'web3-core';
import BigNumber from 'bignumber.js';
const web3 = new Web3('https://goerli.infura.io/v3/c057675750ad44839fb0239fb6229158');
const contract = await new web3.eth.Contract(
[
{
inputs: [],
[271.0MiB/19.26s] Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-symfony$polyfill-util.json into cache
[291.4MiB/19.44s] Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-symfony$polyfill-php56.json into cache
[271.8MiB/19.46s] Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-jdorn$sql-formatter.json into cache
[285.9MiB/19.52s] Writing /root/.composer/cache/repo/https---repo.packagist.org/provider-symfony$doctrine-bridge.json into cache
[279.6MiB/19.57s] Writing /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2013.json into cache
[276.2MiB/19.62s] Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2014.json from cache
[276.7MiB/19.69s] Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2015.json from cache
[277.7MiB/19.79s] Reading /root/.composer/cache/repo/https---repo.packagist.org/p-provider-2016.json from cache
[287.2MiB/19.92s] Reading /root/.composer/cache/repo/https---repo.p
{"code":"QWPRC-780","message":"Проведение платежа запрещено СБ"}
На баланс: 401 Unauthorized
@kricha
kricha / docker-images-builder.yaml
Last active May 8, 2019 12:43
Moving to own registry
#####################################################################
################### DOCKER IMAGES BUILDING ##########################
#####################################################################
variables:
DOCKER_PROD_IMAGE: $CI_REGISTRY_IMAGE:prod
DOCKER_DEV_IMAGE: $CI_REGISTRY_IMAGE:dev
DOCKER_TEST_IMAGE: $CI_REGISTRY_IMAGE:test
DOCKER_HOST: tcp://docker:2375
.docker_builder_template: &docker_builder
services:
@kricha
kricha / FastPagerProvider.php
Last active May 29, 2018 09:36
Fastest custom pager provider for https://github.com/php-enqueue/enqueue-bundle works great with more then 2m rows, also support multiple (parallel) consumers (workers)
<?php
declare(strict_types=1);
namespace AppBundle\ElasticSearch\SearchProvider;
use Doctrine\ORM\EntityManagerInterface;
use FOS\ElasticaBundle\Provider\PagerfantaPager;
use FOS\ElasticaBundle\Provider\PagerInterface;
use FOS\ElasticaBundle\Provider\PagerProviderInterface;
export status_check_new_iredmail="DONE"
export status_fetch_misc="DONE"
export status_check_md5="DONE"
export status_get_all="DONE"
export status_after_package_installation="DONE"
export status_generate_ssl_keys="DONE"
export status_add_user_vmail="DONE"
export status_add_user_iredadmin="DONE"
export status_add_user_iredapd="DONE"
[ INFO ] Checking new version of iRedMail ...
+ < DEBUG > Creating necessary directories ...
[ INFO ] apt-get update ...
[ INFO ] Fetching source tarballs ...
[ INFO ] + 1 of 3: http://iredmail.org/yum/misc/roundcubemail-1.2.4-complete.tar.gz
[ INFO ] + 2 of 3: http://iredmail.org/yum/misc/iRedAPD-2.0.tar.bz2
[ INFO ] + 3 of 3: http://iredmail.org/yum/misc/iRedAdmin-0.7.tar.bz2
[ INFO ] Validate packages ...
[ INFO ] Install package: dialog
[ INFO ] Installing package(s): dialog
@kricha
kricha / exim4.conf
Last active October 6, 2016 19:17
exim4 default configuration with TLS and DKIM
# for example main site domain is domain.tld
primary_hostname = mail_subdomain.domain.tld
domainlist local_domains = domain.tld
DKIM_DOMAIN = ${lc:${domain:$h_from:}}
DKIM_FILE = /etc/exim4/${lc:${domain:$h_from:}}.key
DKIM_PRIVATE_KEY = ${if exists{DKIM_FILE}{DKIM_FILE}{0}}
DKIM_SELECTOR = mail
@kricha
kricha / site.conf
Created September 23, 2016 18:18
nginx https http/2.0 config
server {
server_name domain.tld;
listen 80;
listen 443 ssl http2;
server_tokens off;
keepalive_timeout 70;