This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import com.muquit.libsodiumjna.SodiumLibrary | |
import scorex.crypto.encode.Base58 | |
import scorex.crypto.signatures.Curve25519 | |
object SignAsWaves extends App { | |
SodiumLibrary.setLibraryPath("/usr/local/Cellar/libsodium/1.0.16/lib/libsodium.dylib") | |
val message = "message" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env monkeyrunner | |
import time | |
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice | |
device = MonkeyRunner.waitForConnection() | |
# Touch down screen | |
device.touch(100, 500, MonkeyDevice.DOWN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = seeds.map(s => new PrivateKeyAccount(s, 0, 'W')) | |
val txs = addresses.map(a => Transaction.makeTransferTx(myAcc, a.getAddress, 100000000, Asset.WAVES, 100000, Asset.WAVES, "")) | |
println(seeds.mkString("\n")) | |
println(txs.map(_.getJson)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "tolsi12.id" is my Blockstack ID. https://onename.com/tolsi12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pass size in mb and optional name | |
function ram_disk_mb() { | |
name=${2:-disk} | |
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)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.Executors | |
import scala.concurrent._ | |
import scala.concurrent.duration.Duration | |
import scala.util.{Failure, Try} | |
trait CancellableFuture[T] extends Future[T] { | |
def future(): Future[T] | |
def cancel(): Unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package scala.concurrent.impl | |
import java.util.concurrent.{ExecutorService, Executors, ThreadFactory} | |
import scala.concurrent.{ExecutionContext, ExecutionContextExecutor, Future} | |
import scala.concurrent.forkjoin.ForkJoinPool | |
import scala.util.control.NonFatal | |
import scala.util.{Failure, Success} | |
object Cancelled extends RuntimeException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test | |
import com.decodified.scalassh._ | |
object TestSSH { | |
def main(args: Array[String]) { | |
val res = SSH("host") { client => | |
client.exec("ls -a").right.map { result => | |
println("Result:\n" + result.stdOutAsString()) | |
} |