Skip to content

Instantly share code, notes, and snippets.

@falsetto
falsetto / gist:8066166
Last active January 1, 2016 00:19
WAR-3 Research Document

Objectives

An HBase schema that is well-suited to our dashboard's access patterns and can easily answer the questions we'll ask.

Common questions from our initial dashboard iteration

  • What are the daily sum/average metrics for the last 30 days for this location?
  • What are the daily sum/average metrics for the last 30 days for this list of locations?

Common questions from our eventual dashboard

@falsetto
falsetto / gist:7454107
Last active December 28, 2015 05:59
MongoDB: Find documents where any field matches a search string
db.reportResults912ec803b2ce49e4a541068d495ab570
.find(function() {
for (var field in this) {
if (field.match(/search string/i)) {
return true;
};
}
});
def sorted_key_list(*hashes)
if (result = hashes.map(&:keys).flatten.uniq.sort.map(&:to_s).join(', ')) == ''
'<none>'
else
result
end
end
sorted_key_list({ key1: 1, key2: 2, commonkey: 5 },
{ key3: 3, key4: 4, commonkey: 5 }) # => 'commonkey, key1, key2, key3, key4'
@falsetto
falsetto / Rakefile
Last active December 10, 2015 19:18 — forked from anonymous/Rakefile
# -*- coding: utf-8 -*-
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
Motion::Project::App.setup do |app|
# Use `rake config' to see complete project settings.
app.name = 'core-midi-test'
app.frameworks << 'CoreMIDI'
end
$ rake --trace
** Invoke default (first_time)
** Invoke simulator (first_time)
** Invoke build:simulator (first_time)
** Execute build:simulator
/usr/bin/env VM_KERNEL_PATH="/Library/RubyMotion/data/6.0/iPhoneSimulator/kernel-i386.bc" VM_OPT_LEVEL="0" /Library/RubyMotion/bin/ruby --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/RubyMotion.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/UIKit.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/CoreVideo.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/CoreImage.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/Security.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/Foundation.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/CoreGraphics.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/CoreFoundation.bridgesupport" --uses-bs "/Library/RubyMotion/data/6.0/BridgeSupport/ImageIO.bridgesupport" --uses-bs "/Library/
@falsetto
falsetto / local_tracer_patch.rb
Created December 11, 2012 14:24 — forked from coldnebo/local_tracer_patch.rb
unroller replacement for rails...
# to be used only for local debugging
LK_ENABLE_TRACE = false
if LK_ENABLE_TRACE && Rails.env.development?
require 'thread'
class LkTracer
def initialize
@falsetto
falsetto / _.md
Created November 17, 2012 07:20
Another Inlet
@falsetto
falsetto / _.md
Created November 17, 2012 06:56
Another Inlet
@falsetto
falsetto / _.md
Created November 5, 2012 13:19
just another inlet to tributary