This endpoint returns full transaction data for blocks and Addresses
NOTE: there is an undocumented param to paginate, didn't go digging
| async function fetchAndDownload(url, filename) { | |
| try { | |
| const response = await fetch(url); | |
| const blob = await response.blob(); | |
| const link = document.createElement('a'); | |
| link.href = URL.createObjectURL(blob); | |
| link.download = filename; | |
| link.click(); | |
| URL.revokeObjectURL(link.href); | |
| } catch (error) { |
| let regex; | |
| /* matching a specific string */ | |
| regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
| regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
| regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
| /* wildcards */ | |
| regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
| regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
| /* global chrome, MediaRecorder, FileReader */ | |
| chrome.runtime.onConnect.addListener(port => { | |
| let recorder = null | |
| port.onMessage.addListener(msg => { | |
| console.log(msg); | |
| switch (msg.type) { | |
| case 'REC_STOP': | |
| console.log('Stopping recording') | |
| if (!port.recorderPlaying || !recorder) { |
| # using bitcoinrb | |
| require 'bitcoin' | |
| # oracle | |
| # oracle's key. V = vG | |
| o_key = Bitcoin::Key.new(priv_key: '860f6a0296aae3901e374be83d962351366386fb5f65ffef75c9f389c256e724') | |
| V = o_key.to_point | |
| v = o_key.priv_key.to_i(16) |
This endpoint returns full transaction data for blocks and Addresses
NOTE: there is an undocumented param to paginate, didn't go digging
| import hashlib as hasher | |
| import datetime as date | |
| # Define what a Snakecoin block is | |
| class Block: | |
| def __init__(self, index, timestamp, data, previous_hash): | |
| self.index = index | |
| self.timestamp = timestamp | |
| self.data = data | |
| self.previous_hash = previous_hash |
| import transitions from './transitions.css'; | |
| export default () => ( | |
| <ReactCSSTransitionGroup transitionName={transitions}> | |
| { ... } | |
| </ReactCSSTransitionGroup> | |
| ); |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| (function() { | |
| var FavEmoji = function(unicode) { | |
| 'use strict'; | |
| var | |
| canvas = document.createElement('canvas'), | |
| getContext = function(w) { | |
| canvas.width = canvas.height = w; | |
| context = canvas.getContext('2d'); | |
| context.font = 'normal normal normal 32px/' + w + 'px sans'; | |
| context.textBaseline = 'middle'; |
| module PlaylistBuilder | |
| SEG_DURATION, PKT_SIZE, PKT_POS, PKT_TIME = 0,1,2,3 | |
| def self.extract_iframes_data(video_filepath) | |
| raise "#{video_filepath} does not exists!" unless File.exists?(video_filepath) | |
| iframes_data = [] | |
| cmd = "ffprobe -show_frames -select_streams v -of compact -show_entries packet=pts_time,codec_type,pos:frame=pict_type,pkt_pts_time,pkt_size,pkt_pos -i #{video_filepath.shellescape}" | |
| frames_and_packets = nil | |
| r = Benchmark.measure('') do | |
| frames_and_packets = `#{cmd}`.split("\n") |