Skip to content

Instantly share code, notes, and snippets.

View romanzaycev's full-sized avatar
:octocat:
Octocating

Roman Zaycev romanzaycev

:octocat:
Octocating
  • 19:21 (UTC +07:00)
View GitHub Profile
@romanzaycev
romanzaycev / onchain-metadata.php
Created May 15, 2024 03:05
[PHP][TON] On-chain and semi-chain jetton metadata
<?php declare(strict_types=1);
use Brick\Math\BigInteger;
use Http\Client\Common\HttpMethodsClient;
use Http\Client\Common\HttpMethodsClientInterface;
use Http\Discovery\Psr17FactoryDiscovery;
use Http\Discovery\Psr18ClientDiscovery;
use Olifanton\Interop\Address;
use Olifanton\Interop\Boc\BitString;
use Olifanton\Interop\Boc\Cell;
@romanzaycev
romanzaycev / ton_wallet_address.php
Last active November 15, 2023 04:43
[PHP] TON wallet address generation
<?php // ton_wallet_address.php
// PHP 8.1 is required
use Olifanton\Mnemonic\TonMnemonic;
use \Olifanton\Ton\Contracts\Wallets\V3 as V3;
use \Olifanton\Ton\Contracts\Wallets\V4 as V4;
// 1. composer require olifanton/ton
require_once __DIR__ . "/vendor/autoload.php";
function isIncognitoMode() {
return new Promise(function(resolve, reject) {
var fs = window.RequestFileSystem || window.webkitRequestFileSystem;
if (fs) {
fs(
window.TEMPORARY,
100,
function (fs) {
resolve(false);
}, function (err) {
.system-font-stack {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@romanzaycev
romanzaycev / pagination.jade
Last active May 14, 2020 07:38
Jade (Pug) Bootstrap pagination mixin (Digg-like pagination)
mixin pagination(adjacents, numPages, display, currentPage, base)
- adjacents = (adjacents || 1) * 1;
- numPages = (numPages || 10) * 1;
- currentPage = (currentPage || 1) * 1;
- base = base || '#';
- display = (display || 7) * 1;
ul.pagination
if numPages < display + adjacents * 2
- var p = 1;
@romanzaycev
romanzaycev / call_protected_method.php
Last active February 13, 2020 16:37
[PHP 7] Call protected method with Closure proxy
<?php
class Foo
{
protected function bar($param)
{
var_dump($param);
}
}