Skip to content

Instantly share code, notes, and snippets.

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

Aliaksei Sanikovich asanikovich

🏠
Working from home
View GitHub Profile
@Linch1
Linch1 / tokenPriceApi.js
Last active May 21, 2024 04:43
Retrive the price of any bsc token from it's address without using external service like poocoin/dextools
let pancakeSwapAbi = [
{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"getAmountsOut","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"view","type":"function"},
];
let tokenAbi = [
{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},
];
const Web3 = require('web3');
/*
Required Node.js
@daffoxdev
daffoxdev / AbstractAdminCrudController.php
Last active December 22, 2023 11:58
EasyAdmin 3.2.7 show records list of another controller inside of details page. Can be used as base to continue the idea
<?php
namespace App\Controller\Admin;
use App\Admin\Field\ControllerIndexField;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Config\Actions;
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
use EasyCorp\Bundle\EasyAdminBundle\Config\KeyValueStore;
@nginx-gists
nginx-gists / ubuntu_install.sh
Last active May 31, 2024 10:15
Automating Installation of WordPress with NGINX Unit on Ubuntu
#!/usr/bin/env bash
if [ "$EUID" -ne 0 ];then
>&2 echo "This script requires root level access to run"
exit 1
fi
if [ -z "${WORDPRESS_DB_PASSWORD}" ]; then
>&2 echo "WORDPRESS_DB_PASSWORD must be set"
>&2 echo "Here is a random one that you can paste:"
@jleo84
jleo84 / key_converter.py
Created September 2, 2020 01:45
Convert any Bitcoin key prefix to another (e.g.: xpub to ypub, zpriv to Zpriv)
import hashlib
import base58
import sys
prefix_dict = {
"xprv": "0488ade4", # Mainnet - P2PKH or P2SH - m/44'/0'
"yprv": "049d7878", # Mainnet - P2WPKH in P2SH - m/49'/0'
"zprv": "04b2430c", # Mainnet - P2WPKH - m/84'/0'
"Yprv": "0295b005", # Mainnet - Multi-signature P2WSH in P2SH
"Zprv": "02aa7a99", # Mainnet - Multi-signature P2WSH
@eddywm
eddywm / memo_checker.md
Last active March 31, 2023 14:30
ENABLING MEMO CHECKER

ENABLING MEMO CHECKER FOR AN ADDRESS

1. Install Binance-Chain Node CLI

sh <(wget -qO- https://raw.githubusercontent.com/onggunhao/node-binary/master/install.sh)

2. Add Wallet Phrase to the Node CLI

bnbcli keys add BEP2_WALLET --recover

@pmurzakov
pmurzakov / Badoo PHP Meetup #3 2019 talk.md
Last active March 30, 2021 14:40
PHP shared nothing, preload, RoadRunner -- useful links and snippets -- Badoo PHP Meetup #3 2019 talk
@Harold2017
Harold2017 / go_cpu.md
Created June 25, 2019 04:48
golang cpu usage in docker

Golang CPU usage in docker

// test.go
package main

import (
	"fmt"
@mpociot
mpociot / CanBeReplicated.php
Created June 12, 2019 12:32
Add the ability to replicate Laravel models to other models.
<?php
use Illuminate\Support\Arr;
trait CanBeReplicated
{
public function replicateTo(string $model, array $with = null, array $except = null)
{
$defaults = [
$this->getKeyName(),
@pmurzakov
pmurzakov / Badoo PHP Russia 2019 talk.md
Last active September 10, 2021 22:01
Badoo PHP performance -- useful links and snippets -- PHP Russia 2019 talk