(k+j)*H = k*H + j*H
in node js
type Callback<T> = () => Promise<T> | |
export type AsyncQueue<T = void> = { | |
push: (task: Callback<T>) => Promise<T> | |
flush: () => Promise<void> | |
size: number | |
} | |
/** | |
* Ensures that each callback pushed onto the queue is executed in series. |
/* Sample Code for connecting to the V3 Secure API via Node | |
* | |
* With thanks to xiaojay of Niffler Wallet: | |
* https://github.com/grinfans/Niffler/blob/gw3/src/shared/walletv3.js | |
* | |
*/ | |
const http = require('http'); | |
const crypto = require('crypto'); |
defmodule PoolboyApp.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
defp poolboy_config do | |
[ | |
{:name, {:local, :worker}}, |
FROM rust:1.31 | |
RUN apt-get install -y git cmake make zlib1g-dev pkgconf ncurses-dev \ | |
libncursesw5-dev linux-headers-generic g++ libssl-dev | |
WORKDIR /usr/src | |
RUN git clone https://github.com/mimblewimble/grin-miner.git | |
WORKDIR /usr/src/grin-miner |
function promisify(f: any) { | |
return function () { | |
let args = Array.prototype.slice.call(arguments) | |
return new Promise(function (resolve, reject) { | |
args.push(function (err: any, result: any) { | |
if (err) reject(err) | |
else resolve(result) | |
}) | |
f.apply(null, args) | |
}) |
if [ $1 = "user1" ] | |
then | |
echo "user : $1"; | |
echo -e "registry=http://registry.npmjs.org/\n//registry.npmjs.org/:_authToken=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" > ~/.npmrc; | |
elif [ $1 = "user2" ] | |
then | |
echo "user : $1"; | |
echo -e "registry=http://registry.npmjs.org/\n//registry.npmjs.org/:_authToken=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" > ~/.npmrc; | |
fi |
package main | |
import "fmt" | |
import "os/exec" | |
import "bufio" | |
import "bytes" | |
func main() { | |
//create cmd |
defmodule Shell do | |
def exec(exe, args) when is_list(args) do | |
port = Port.open({:spawn_executable, exe}, [{:args, args}, :stream, :binary, :exit_status, :hide, :use_stdio, :stderr_to_stdout]) | |
handle_output(port) | |
end | |
def handle_output(port) do | |
receive do | |
{^port, {:data, data}} -> | |
IO.puts(data) |
const http = require('http') | |
class RPCClient { | |
/** | |
* * Creates an instance of RPCClient. | |
* * | |
* * @param {any} options {hostname:string, port:number, user:string, pass:string, timeout: number} | |
* * @memberof RPCClient | |
* */ |