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 'json' | |
require 'yaml' | |
require 'uri' | |
require 'net/http' | |
require 'ipaddr' | |
############## CONFIG ############## | |
API_KEY = "YOUR API KEY, REGISTER AT https://adapools.org/register" | |
CONFIG_DIR = 'C:\Program Files\Daedalus - Rewards v1' | |
PEERS_URL = "https://api.adapools.org/v0/peers" |
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
--- | |
rest: | |
listen: 127.0.0.1:3100 | |
log: | |
- format: plain | |
level: info | |
output: stderr | |
p2p: | |
topics_of_interest: | |
blocks: normal |
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
public class TestDBVolume { | |
static int maxVolumeLevel = 20; | |
static int minDBLevel = -100; | |
public static void main(String[] args) { | |
for (int volume = 0; volume <= maxVolumeLevel; ++volume) { | |
int volumeInDecibels = calulateDSPVolume(volume); | |
String output = String.format("volume: %d, db = %d", volume, volumeInDecibels); | |
System.out.println(output); | |
} |
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
"use strict"; | |
// https://github.com/scottwrobinson/camo/issues/57 | |
const Document = require('camo').Document; | |
const assert = require('assert'); | |
class Foo extends Document { | |
constructor() { | |
super(); | |
this.bar = String; | |
} |
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
"use strict"; | |
// bug using findOneAndUpdate with nested updates in nedb client | |
// https://github.com/scottwrobinson/camo/blob/master/lib/clients/nedbclient.js#L155 | |
const EmbeddedDocument = require('camo').EmbeddedDocument; | |
const Document = require('camo').Document; | |
class Contact extends EmbeddedDocument { | |
constructor() { | |
super(); |
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
#!/bin/env ruby | |
require 'pg/em/connection_pool' | |
# psql test <<EOF | |
# CREATE TABLE bar ( | |
# key integer, | |
# value character varying | |
# ); | |
# EOF | |
EM.run do |
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
var assert = require('assert'); | |
function timer(fun) { | |
var start = Date.now(); | |
try { | |
fun() | |
} catch(e) { | |
console.error(e); | |
} | |
console.log((Date.now() - start) / 1000 + 's'); |