This file contains 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
// Define types | |
type Result<'T> = | |
| Success of 'T | |
| Error of string | |
type LogState = { Logs: string list } | |
type ResultLog<'T> = Result<'T> * LogState |
This file contains 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
#ifndef MEMORY_MANAGER_H | |
#define MEMORY_MANAGER_H | |
#define HEAP_SIZE (10 * 1024 * 1024) | |
#include <stdlib.h> | |
typedef struct memory_manager_malloc_t { | |
void *ptr; | |
} memory_manager_malloc_t; |
This file contains 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
document.getElementById("get-unspents").addEventListener("click", function(event) { | |
getUnspentOutputs = function(callback) { | |
xhr("https://www.blockai.com/chain/testnet/addresses/" + address + "/unspents", function(err, res, body) { | |
var unspentOutputs = JSON.parse(body); | |
unspentOutputs.forEach(function(utxo) { | |
utxo.txHash = utxo.hash; | |
utxo.index = utxo.outputIndex; | |
}); | |
callback(err, unspentOutputs); |
This file contains 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
[ | |
"/earth/me/me/kittery-point/03905", | |
"/earth/me/me", | |
"/earth/us/me", | |
"/earth/me/me/kittery", | |
"/earth/us/me/south-eliot", | |
"/earth/us/co", | |
"/earth/us/ca/huntington-beach/92647", | |
"/earth/us/ca/huntington-beach/92648", | |
"/earth/us/ca/huntington-beach/92646", |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
.marker-properties { | |
border-collapse:collapse; |
This file contains 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
RunLoop(document.querySelector("canvas"), function(context, tick) { | |
context.fillRect(Math.sin(tick/5)*20 + 100, 20, 40, 40); | |
}).play(); |
This file contains 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
define(['graph_editor/register_core'], function(registerCore) { | |
var Edge = function(options) { | |
this._initEdge(options); | |
}; | |
Edge.prototype = { | |
_initEdge: function(options) { |
This file contains 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
require 'colored' | |
class RegExAvailableDomains | |
def initialize(regex, show_output) | |
@regex = regex | |
@show_output = show_output | |
@matching_words = [] | |
@available_domains = [] | |
find |
This file contains 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 play | |
`osascript -e 'tell application "iTunes" to play'` | |
end | |
def pause | |
`osascript -e 'tell application "iTunes" to pause'` | |
end | |
pause | |
(1..50).to_a.reverse.each do |n| |
This file contains 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
require "matrix" | |
#First, you construct an adjacency matrix. An adjacency matrix is just a matrix of what is linking to what. | |
#[0, 1, 1, 1, 1, 0, 1] | |
#[1, 0, 0, 0, 0, 0, 0] | |
#[1, 1, 0, 0, 0, 0, 0] | |
#[0, 1, 1, 0, 1, 0, 0] | |
#[1, 0, 1, 1, 0, 1, 0] | |
#[1, 0, 0, 0, 1, 0, 0] |
NewerOlder