Skip to content

Instantly share code, notes, and snippets.

View coinables's full-sized avatar
💭
@coinables on Twitter

coinableS coinables

💭
@coinables on Twitter
View GitHub Profile
Verifying that +coinables is my blockchain ID. https://onename.com/coinables
<?php
$APIkey = "yourAPIkey"; //change to your apikey
$ClientId = "yourClientId"; //change to your clientID
$secret = "yourAPIsecret"; //change to your API secret, provided when you get your API key
$nonce = microtime();
$Data = $nonce.$APIkey.$ClientId;
$hmac = base64_encode(hash_hmac('sha256', $Data, $secret, true));
@coinables
coinables / example.html
Created June 20, 2017 03:01
coincap.io with socket.io example
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>
</head>
<body>
<script type="text/javascript">
var socket = io.connect('http://socket.coincap.io');
socket.on('trades', function (tradeMsg) {
@coinables
coinables / test.php
Created May 3, 2018 02:15
coinpayments api generate new address example
<?php
// This example will create a new deposit address for a desired currency
// Link to the related documentation https://www.coinpayments.net/apidoc-get-deposit-address
////////////////////////////////////////////////////
// Fill these in from your API Keys page
$public_key = '';
$private_key = '';
<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;
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
$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);
@coinables
coinables / index.html
Created June 13, 2018 04:51
lightning nodes & edges
<!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>
@coinables
coinables / transaction.js
Created June 14, 2019 23:55
Create a testnet key pair
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 / keybase.md
Created November 19, 2019 19:49
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: