Skip to content

Instantly share code, notes, and snippets.

View Anderson-Juhasc's full-sized avatar
:octocat:
Looking for work

Anderson Juhasc Anderson-Juhasc

:octocat:
Looking for work
View GitHub Profile
@Anderson-Juhasc
Anderson-Juhasc / index.html
Last active March 25, 2017 15:18
Socket.io bitcoin address
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>
<script type="text/javascript">
var socket = io('ws://localhost:8000', {
/**
* Main js file for WebRTC-Camera-Resolution finder
* Created by chad on 7/19/2014.
* Modified January 1, 2016
*/
'use strict';
//Global variables
var video = $('#video')[0], //where we will put & test our video output
//check for getUserMedia
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia;
let devices = [];
if (navigator.mediaDevices) {
navigator.mediaDevices.enumerateDevices()
.then(function (deviceInfos) {
for (let i = 0; i !== deviceInfos.length; ++i) {
var bitcore = require('bitcore-lib');
bitcore.Networks.defaultNetwork = bitcore.Networks.testnet;
var HDPrivateKey = bitcore.HDPrivateKey;
var explorers = require('bitcore-explorers');
var client = new explorers.Insight();
var hdPrivateKey = new HDPrivateKey('tprv8ZgxMBicQKsPd194pj9j68Cc5vTVKdQzDKmN8G5EEhvuct5bg2pifdAGGJZoJUQm9McBpvKQqTwfoLuvxgaVKJhtCLHFjG9MiJ4xeemMFyz');
<?php
require __DIR__ . '/vendor/autoload.php';
use \Blocktrail\SDK\BlocktrailSDK;
$client = new BlocktrailSDK("api_key", "secret", "BTC", true /* testnet */);
$wallet = $client->initWallet("wallet_name", "password");
<?php
$country = Request::segment(1);
$locale = Request::segment(2);
if (Schema::hasTable('countries')) {
$Country = \App\Countries::where('name_iso3166', $country)->get();
if (count($Country)) {
$available_lang = explode(',', $Country[0]['available_languages']);
// constructor
function Bot(api_key, secret) {
var self = this;
self.ticker = null;
if (channels) {
self.subscribe(channels);
}
<!DOCTYPE HTML>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div ng-controller="ctrl"></div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
$.ajax({
type: "GET",
url: "http://query.yahooapis.com/v1/public/yql",
jsonp: "callback",
dataType: "jsonp",
data: {
q: 'select * from html where url = "http://api.bitvalor.com/v1/ticker.json"',
format: 'json'
},
success: function(response) {
<?php
use Blocktrail\SDK\BlocktrailSDK;
$value = BlocktrailSDK::toSatoshi(1.1);
$wallet->pay(array('1NcXPMRaanz43b1kokpPuYDdk6GGDvxT2T' => $value));