Skip to content

Instantly share code, notes, and snippets.

View mattknox's full-sized avatar

matt knox mattknox

View GitHub Profile
class LcmFinder
attr_accessor :seen, :factors
def initialize
@seen = Set.new
@factors = Hash.new(0)
end
def factor(n)
cur = n
@mattknox
mattknox / Gemfile
Created August 9, 2011 03:42 — forked from victusfate/Gemfile
Rails 3.1 Beta 1 on Heroku Working Config
# source 'http://rubygems.org'
source :gemcutter
gem 'rails', '3.1.0.beta1'
# Asset template engines
gem 'json'
gem 'sass'
gem 'coffee-script'
gem 'uglifier'
@mattknox
mattknox / gist:1135211
Created August 9, 2011 21:11
asshat bizdev guy spews jargon, signifying nothing.
As a strategic consulting firm focused on Innovation and Growth Strategies, I wanted to take an opportunity to introduce myself and our firm. I understand that you and your colleagues may be in the midst of evaluating new initiatives in this area, hence the timing of this introduction.
I would like to present Harrison Hayes‘ approach to the creation and validation of market growth strategies and how our methodologies may fit your objectives at Twitter.
At Harrison Hayes, our suite of service includes:
Whitespace Opportunity Identification / Disruptive Ideation
Market Access/Market Landscaping / Emerging Market Analysis
Technology Scouting / New Product Validation
Market Adjacency Mapping
@mattknox
mattknox / about.md
Created August 22, 2011 07:09 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
require "rubygems"
require "rbench"
require "set"
RANGE = (1..1000)
ARRAY = RANGE.to_a
SET = Set.new(ARRAY)
HASH = ARRAY.inject({}) {|m, x| m[x] = true; m}
WORST_CASE_COMPLEXITY = ARRAY.size + 1
@mattknox
mattknox / gist:3239851
Created August 2, 2012 19:14 — forked from swannodette/gist:3217582
sudoku_compact.clj
(ns sudoku
(:refer-clojure :exclude [==])
(:use clojure.core.logic))
(defn get-square [rows x y]
(for [x (range x (+ x 3))
y (range y (+ y 3))]
(get-in rows [x y])))
(defn init [vars hints]
@mattknox
mattknox / political_anagram.rb
Created August 17, 2012 20:42
a function to determine whether 2 strings are anagrams, with application.
def str_to_letter_hash(str)
str.downcase.gsub(/[^a-z]/, "").split("").sort.inject(Hash.new(0)) {|m, x| m[x] += 1; m }
end
def anagrams?(s1, s2)
str_to_letter_hash(s1) == str_to_letter_hash(s2)
end
anagrams? "Mitt Romney and Paul Ryan", "My ultimate Ayn Rand Porn"
=> true
# Ever get tired of people messing with your ruby classes?
# now you can put the hammer down and stop them. Just
# include this module and no one will be able to modify the
# class implementation or any instance implementations.
module Stop
module CantTouchThis
def self.included(mod)
@mattknox
mattknox / rpn.rb
Created August 14, 2013 17:48
two different versions of an RPN calculator
OPERATORS = %w{ + - * / }
def tokenize(s)
s.split.map do |x|
if OPERATORS.member? x
x.to_sym
else
x.to_i
end
end
When judging statements by an unknown actor, I tend to evaluate such statements by the cost of making them. So if I work for a company that says they value me, that's nice, but it's cheap (~free!) to say and therefore unpersuasive. If they just bought my company/gave me a bunch of equity/took other expensive action, I would attach more weight to what they said.
So, you don't trust a16z's statements about whether we're in a bubble, presumably because he has an interest in the outcome. I do trust that he thinks we are not in a bubble, because he continues to invest his and others' money at current valuations. It's moderately expensive in reputation and monetary risk for him to do so, so I trust somewhat that he believes as he says he does.
The other metric I use for evaluating trustworthiness is how much value someone would derive by me believing what they say. By this metric, a16z has something to gain by people believing we are not in a bubble-they have holdings in a bunch of public companies, includin