Skip to content

Instantly share code, notes, and snippets.


Mark Morris blurredbits

View GitHub Profile
View memmap.txt
Type Start End # Pages Attributes
Available 0000000000000000-000000000009EFFF 000000000000009F 000000000000000F
Reserved 000000000009F000-000000000009FFFF 0000000000000001 000000000000000F
Available 0000000000100000-000000001DF0DFFF 000000000001DE0E 000000000000000F
BS_Data 000000001DF0E000-000000001DF4DFFF 0000000000000040 000000000000000F
Available 000000001DF4E000-0000000033FAFFFF 0000000000016062 000000000000000F
LoaderCode 0000000033FB0000-00000000340D4FFF 0000000000000125 000000000000000F
BS_Data 00000000340D5000-0000000035DEFFFF 0000000000001D1B 000000000000000F
ACPI_NVS 0000000035DF0000-0000000035DF0FFF 0000000000000001 000000000000000F
RT_Data 0000000035DF1000-0000000035DF1FFF 0000000000000001 800000000000000F

Crafting Code

Here's the thing. Computers are nothing more than really fast light switches. On & off millions of times per second. All it cares about is ones & zeroes.

So when it comes to code, and more specifically crafting code, who are we really writing code for?

We're writing it for ourselves, our teammates or our customers - basically other humans. We're using code to express ideas, human ideas in terms of a computer language. As developers, we're tasked with creating sets of instructions to be carried out by our dumb servants to execute these ideas.

If the computer doesn't particularly care about code (other than a clean compile) - what are some of the tools we can use to craft our code for human consumption?

blurredbits / statsd_timer_example.rb
Created Jul 31, 2015
Sample for code for StatsD Timer
View statsd_timer_example.rb
require 'statsd-ruby'
statsd ='localhost', 8125)
# Single call to statsd timer.
statsd.time("timer_data") do
timer_data = 1 + Random.rand(6)
puts timer_data
sleep timer_data
blurredbits / docker_commands
Last active Aug 29, 2015
Kafka Docker Commands
View docker_commands
docker run -d \
--name zookeeper \
--publish 2181:2181 \
docker run -d \
--name kafka \
--link zookeeper:zookeeper \
--publish 9092:9092 --publish 7203:7203 \
blurredbits / mongo_consumer.rb
Last active Aug 29, 2015
Kafka Mongo Consumer
View mongo_consumer.rb
#!/usr/bin/env ruby
require 'poseidon'
require 'mongo'
Mongo::Logger.logger.level = Logger::WARN
db =[''], database: 'metrics')
consumer ="mongo_consumer", "localhost", 9092, "metrics", 0, :earliest_offset)
blurredbits / pg_consumer.rb
Last active May 17, 2018
Kafka PostgreSQL Consumer
View pg_consumer.rb
#!/usr/bin/env ruby
require 'poseidon'
require 'pg'
conn = PG.connect(host: 'localhost', port: 5432, dbname: 'postgres', user: 'postgres')
conn.exec("CREATE DATABASE metrics")
rescue PG::DuplicateDatabase
blurredbits / producer.rb
Created Jun 30, 2015
Kafka Producer Example
View producer.rb
#!/usr/bin/env ruby
require 'poseidon'
producer =["localhost:9092"], "test_producer")
loop do
messages = []
messages <<"metrics", "timestamp: #{}, metric: #{rand(10..30)}")
View container_monitor.rb
#!/usr/bin/env ruby
require 'excon'
require 'statsd-ruby'
require 'json'
module ExconConnection
class << self

Keybase proof

I hereby claim:

  • I am blurredbits on github.
  • I am 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:

View student.js
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) {