I hereby claim:
- I am blurredbits on github.
- I am blurredbits (https://keybase.io/blurredbits) on keybase.
- I have a public key whose fingerprint is E089 8BC5 353D 1E11 4AFB DF15 AE8B 21F9 6723 91E2
To claim this, I am signing this object:
puts "Please enter a number you would like to convert to a roman numeral" | |
num = gets.chomp.to_i | |
def to_roman(num) | |
results = "" | |
digits = [ | |
[1000, "M"], | |
[900, "CM"], | |
[500, "D"], |
puts "Let's play a guessing game. " | |
puts "I'll pick a number from 1 to 20. You try to guess it." | |
puts "Please enter a number: " | |
answer = 1 + rand(19) | |
number_of_guesses = 0 | |
begin | |
guess = gets.chomp.to_i | |
if guess < answer |
validate('first_name', 'email', 'dream', 'password', 'password_confirm', function(value) { | |
if (this.is_empty(value)) { | |
return "Cannot be empty"; | |
} | |
return true; | |
}) | |
validate('form', function(elements) { | |
if (elements['first_name'].value == elements['last_name'].value) { |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
require 'poseidon' | |
producer = Poseidon::Producer.new(["localhost:9092"], "test_producer") | |
loop do | |
messages = [] | |
messages << Poseidon::MessageToSend.new("metrics", "timestamp: #{Time.now.to_i}, metric: #{rand(10..30)}") | |
producer.send_messages(messages) |
#!/usr/bin/env ruby | |
require 'poseidon' | |
require 'mongo' | |
Mongo::Logger.logger.level = Logger::WARN | |
db = Mongo::Client.new(['127.0.0.1:27017'], database: 'metrics') | |
consumer = Poseidon::PartitionConsumer.new("mongo_consumer", "localhost", 9092, "metrics", 0, :earliest_offset) |
docker run -d \ | |
--name zookeeper \ | |
--publish 2181:2181 \ | |
jplock/zookeeper:3.4.6 | |
docker run -d \ | |
--name kafka \ | |
--link zookeeper:zookeeper \ | |
--publish 9092:9092 --publish 7203:7203 \ | |
--env EXPOSED_HOST=127.0.0.1 --env ZOOKEEPER_IP=127.0.0.1 \ |
require 'statsd-ruby' | |
statsd = Statsd.new('localhost', 8125) | |
# Single call to statsd timer. | |
statsd.time("timer_data") do | |
timer_data = 1 + Random.rand(6) | |
puts timer_data | |
sleep timer_data | |
end |
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
Zoo = { | |
init: function(animals) { | |
Zoo = new Array(animals); | |
} | |
}; |