This file contains hidden or 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
function $(id) { return document.getElementById(id) } | |
import Bitcoin from "bitcoinjs-lib" | |
document.addEventListener("DOMContentLoaded", ()=>{ | |
const btn = $('create-address'); | |
if(! btn) | |
return | |
This file contains hidden or 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
class Bitcoins::Index < BrowserAction | |
get "/bitcoins" do | |
addresses = Array(Tuple(String, String, String)).new | |
render IndexPage, addresses: addresses | |
end | |
end |
This file contains hidden or 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
abstract class MainLayout | |
# Edit shared layout code in src/components/shared/layout.cr | |
include Shared::Layout | |
# 'needs current_user : User' makes it so that the current_user | |
# is always required for pages using MainLayout | |
needs current_user : User | |
def render | |
html_doctype |
This file contains hidden or 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 io.swagger.client.auth.*; | |
import io.swagger.client.model.*; | |
import io.swagger.client.api.AddressAPIApi; | |
import java.io.File; | |
import java.util.*; | |
public class AddressAPIApiExample { |
This file contains hidden or 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
class Api::Addresses::Balance < ApiAction | |
param contract_id : String? | |
param decimal_places : Int32? | |
before check_for_valid_api_key | |
before check_valid_coins | |
get "/api/address/balance/:coin/:address" do | |
This file contains hidden or 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
module OnChain | |
module Protocol | |
class ZCashTransaction < UTXOTransaction | |
property version_group_id : UInt32 | |
property join_split_size : UInt64 | |
property expiry_height : UInt32 | |
def initialize(unspents : Array(UnspentOut), outputs : Array(UTXOOutput)) | |
This file contains hidden or 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
def hash_signature_for_input(input_idx : Int32) : String | |
buffer = IO::Memory.new | |
# 1. Version | |
buffer.write_bytes(ver, IO::ByteFormat::LittleEndian) | |
# 2. Inputs | |
Transaction.write_var_int(buffer, inputs.size.to_u64) | |
inputs[input_idx].to_buffer(buffer) |
This file contains hidden or 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.calypso.tk.util.ConnectionUtil | |
import java.io.FileOutputStream | |
import java.io.IOException | |
import java.io.File | |
import java.net.URL | |
fun main(args : Array<String>) { | |
addSSLSettings() |
This file contains hidden or 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.calypso.tk.core.Log; | |
import com.calypso.tk.core.Trade; | |
import com.calypso.tk.service.DSConnection; | |
import com.calypso.tk.util.ConnectionUtil; | |
import calypsox.apps.startup.StartSecureCustomApplication; | |
public class UseDataServer extends StartSecureCustomApplication { | |
public static void main(String[] args) { |
This file contains hidden or 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
$env = "https://some.domain/webstart/application-jars/" | |
$jnlp = "C:\jars\jnlp.jnlp" | |
$wc = New-Object System.Net.WebClient | |
foreach ($line in [System.IO.File]::ReadLines($jnlp)) { | |
# do something with $line | |
$arr = $line -split 'application-jars/' | |
$arr2 = $arr[1] -split '" main=' | |
if($arr2[0]) { | |
$name = $arr2[0] |