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
require 'resolv' | |
Resolv::DNS.new.each_address('example.com') { |addr| puts "#{addr}" } | |
# 93.184.216.34 | |
# 2606:2800:220:1:248:1893:25C8:1946 | |
require 'packable' | |
Resolv::DNS.new.each_address('example.com') { |addr| puts "#{addr}" } | |
# no output |
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
require 'bigdecimal' | |
require 'enumerable/statistics' | |
array = [*0..100].inject([]) { |memo, n| | |
memo << { | |
timestamp: Time.now, | |
value: rand(0..100) | |
} | |
memo | |
} |
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
CREATE KEYSPACE kairosdb WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'} AND durable_writes = true; | |
CREATE TABLE kairosdb.data_points ( | |
key blob, | |
column1 blob, | |
value blob, | |
PRIMARY KEY (key, column1) | |
) WITH COMPACT STORAGE | |
AND CLUSTERING ORDER BY (column1 ASC) | |
AND bloom_filter_fp_chance = 0.01 |