Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
@coinables on Twitter

coinableS coinables

💭
@coinables on Twitter
View GitHub Profile
View gist:97d8406c7044d0263257240116c2753f
var s = window.speechSynthesis;
var enc = "Yml0Y29pbiBpcyB0aGUgYmVzdA==";
var u = new SpeechSynthesisUtterance(atob(enc));
s.speak(u);
View bitcoin.php
<?php
//replace with your BIP32 extended public key
$xpub = "xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz";
$url = "https://api.blockchair.com/bitcoin/dashboards/xpub/".$xpub;
$fgc = json_decode(file_get_contents($url), true);
$addrlen = count($fgc["context"]["checked"]);
View keybase.md

Keybase proof

I hereby claim:

  • I am coinables on github.
  • I am m1xolyd1an (https://keybase.io/m1xolyd1an) on keybase.
  • I have a public key ASAOG__GbbKo00EB2D8YqNirmgp0gia8HiuM7JTePuTP3Ao

To claim this, I am signing this object:

@coinables
coinables / transaction.js
Created Jun 14, 2019
Create a testnet key pair
View transaction.js
let bitcoin = require("bitcoinjs-lib");
function getNewAddress(){
let NETWORK = bitcoin.networks.testnet; //main net bitcoin.networks.bitcoin
let wif = bitcoin.ECPair.makeRandom({network: NETWORK}).toWIF();
let keyPair = bitcoin.ECPair.fromWIF(wif, NETWORK);
//p2pkh
let p2pkhAddr = keyPair.getAddress();
@coinables
coinables / index.html
Created Jun 13, 2018
lightning nodes & edges
View index.html
<!DOCTYPE html>
<html>
<head>
<!-- START SIGMA IMPORTS -->
<script src="../src/sigma.core.js"></script>
<script src="../src/conrad.js"></script>
<script src="../src/utils/sigma.utils.js"></script>
<script src="../src/utils/sigma.polyfills.js"></script>
<script src="../src/sigma.settings.js"></script>
<script src="../src/classes/sigma.classes.dispatcher.js"></script>
View nodes.json
{ "nodes" :
[
{ "nodeid" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "alias" : "???? EXANTE", "color" : "007f39", "last_timestamp" : 1516636793, "addresses" :
[
{ "type" : "ipv4", "address" : "148.251.53.235", "port" : 9735 } ] },
{ "nodeid" : "03867da6ba2e32bd6e6e32de8cc010711eeabd73235d6e49544a9229b02b3d35a2", "alias" : "WEIRDARK", "color" : "03867d", "last_timestamp" : 1516844101, "addresses" :
[ ] },
{ "nodeid" : "03b81284c8aba3409cd3720a96089011f4bd6512017ae7f81bf4175a9d22def343", "alias" : "EksiSozlukLN", "color" : "316293", "last_timestamp" : 1517650435, "addresses" :
[
{ "type" : "ipv4", "address" : "188.166.88.130", "port" : 9735 } ] },
View channels.json
This file has been truncated, but you can view the full file.
{ "channels" :
[
{ "source" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "destination" : "035f1498c929d4cefba4701ae36a554691f526ff60b1766badd5a49b3c8b68e1d8", "short_channel_id" : "505198:1139:1", "flags" : 0, "active" : true, "public" : true, "last_update" : 1516847709, "base_fee_millisatoshi" : 546000, "fee_per_millionth" : 10, "delay" : 14 },
{ "source" : "028e5a8e86540f703e1f58880d35d1e318a54c27d84ec1edbcde04a78ed4469a1e", "destination" : "02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432", "short_channel_id" : "505206:1066:1", "flags" : 0, "active" : true, "public" : true, "last_update" : 1516636771, "base_fee_millisatoshi" : 546000, "fee_per_millionth" : 10, "delay" : 14 },
View gist:775a696d068425aa361c70e810d9cd60
$apikey = "your_key";
$apisecret = "your_secret":
function bittrexbalance($apikey, $apisecret){
$nonce=time();
$uri='https://bittrex.com/api/v1.1/account/getbalances?apikey='.$apikey.'&nonce='.$nonce;
$sign=hash_hmac('sha512',$uri,$apisecret);
$ch = curl_init($uri);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('apisign:'.$sign));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
View gist:3505fa0c65031894325af9b954ea5bff
const express = require("express");
const request = require("request");
const bodyparser = require("body-parser");
const bitcore = require("bitcore-lib");
const app = express();
app.use(
bodyparser.urlencoded({
extended: true
View gist:ffa33d3a1983b12bfdb68fcdac71ca99
<html>
Create Brain Wallet
<h1>BTC USD Converter</h1>
<input type="text" id="btc" value="1" onkeyup="return btcusd();" onchange="return btcusd();"> =
<input type="text" id="usd" value="<%= lastPrice %>" onkeyup="return usdbtc();" onchange="return usdbtc();">
<script>
function btcusd(){
let market_price = <%= lastPrice %>;
let btc_value = document.getElementById("btc").value;
let calc = btc_value * market_price;
You can’t perform that action at this time.