Skip to content

Instantly share code, notes, and snippets.

I am jumping on the keyboard

Sergey Tolmachev Tolsi

I am jumping on the keyboard
Block or report user

Report or block Tolsi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tolsi on github.
  • I am tolsi ( on keybase.
  • I have a public key ASA0CeTgUKQhTLd-uw2sGJ9r8dBNvuXpKyS5jm2bQESQ5Ao

To claim this, I am signing this object:

Tolsi / Base58Length.scala
Created May 21, 2018
Scala base58 bytes array size by string and string length by bytes array size
View Base58Length.scala
object Base58Length {
private val BytesMaxValue = 256
private val Base58MaxValue = 58
private val BytesLog = math.log(BytesMaxValue)
private val BaseLog = math.log(Base58MaxValue)
def base58Length(byteArrayLength: Int): Int = math.ceil(BytesLog / BaseLog * byteArrayLength).toInt
def bytesLength(base58Length: Int): Int = math.ceil(BaseLog / BytesLog * base58Length).toInt
Tolsi /
Created Mar 13, 2018
Export CryptoPro keys from Windows Regedit format
# Конвертация выгрузки ключей CryptoPro из реестра Windows в папочку с бинарными ключами
# Из реестра выгружать ветку HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Crypto Pro\Settings\Users\<кто-то>\Keys
# Converting the exported CryptoPro keys from the Windows registry to the container folder with binary keys
# Dump regedit path from the registry HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Crypto Pro\Settings\Users\<username>\Keys
Tolsi / SignAsWaves.scala
Created Feb 14, 2018
Sign Ed25519 As Whisper Systems Curve25519 used at Waves
View SignAsWaves.scala
package test
import com.muquit.libsodiumjna.SodiumLibrary
import scorex.crypto.encode.Base58
import scorex.crypto.signatures.Curve25519
object SignAsWaves extends App {
val message = "message"
Tolsi / gist:d8b06b37350f203618a1a7b07f07ea42
Created Feb 4, 2018 — forked from sjp38/gist:6202539
Sample code for monkeyrunner's MOVE usage
View gist:d8b06b37350f203618a1a7b07f07ea42
#!/usr/bin/env monkeyrunner
import time
from import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
# Touch down screen
device.touch(100, 500, MonkeyDevice.DOWN)
Tolsi / gist:bf2133e669880cfd91f70ae62a80c64d
Created Dec 22, 2017
Waves distribution using WavesJ
View gist:bf2133e669880cfd91f70ae62a80c64d
import com.wavesplatform.wavesj.{Asset, Node, PrivateKeyAccount, Transaction}
object Mainb extends App {
val seeds = Seq.fill(30)(PrivateKeyAccount.generateSeed())
val myAcc = new PrivateKeyAccount("", 0, 'W')
val addresses = => new PrivateKeyAccount(s, 0, 'W'))
val txs = => Transaction.makeTransferTx(myAcc, a.getAddress, 100000000, Asset.WAVES, 100000, Asset.WAVES, ""))
package org.bluetooth.bledemo;
import java.util.HashMap;
import android.util.SparseArray;
public class BleNamesResolver {
private static HashMap<String, String> mServices = new HashMap<String, String>();
private static HashMap<String, String> mCharacteristics = new HashMap<String, String>();
private static SparseArray<String> mValueFormats = new SparseArray<String>();
View gist:45b957f5a021e4af9838882eb1a02a20
Verifying that "" is my Blockstack ID.
Tolsi /
Last active Jun 7, 2016
Bash functions for create/mount and umount RAM partitions for Mac OS X 10.11
# pass size in mb and optional name
function ram_disk_mb() {
diskutil erasevolume HFS+ "ram_$name" $(hdiutil attach -nomount ram://$(($1*2048)))
# pass size in gb and optional name
function ram_disk_gb() {
ram_disk_mb $(($1*1024))
View SQLToIterator.scala
package scalikejdbc
import java.sql.{Connection, ResultSet, SQLException}
import java.util.{Timer, TimerTask}
import scala.collection._
import scala.util.Try
object SQLToIterator {
def apply[A, E <: WithExtractor](sql: SQL[A, HasExtractor])(implicit connectionPool: ConnectionPool): SQLToIterator[A, E] = {
You can’t perform that action at this time.