Skip to content

Instantly share code, notes, and snippets.

View rickhull's full-sized avatar

Rick Hull rickhull

View GitHub Profile
@rickhull
rickhull / test.rs
Last active November 9, 2017 01:21 — forked from Dasms/test.rs
prices = {
"tennis ball" => 4.99,
"beach ball" => 12.99,
"giraffe" => 93.86,
}
print "What is your name? "
name = gets.chomp
@rickhull
rickhull / open_named_pipe.rb
Last active November 1, 2017 23:40
Opens a named pipe in given path, creates the named pipe -file if needed
# Open one end of named pipe
# @argument pipe_path - path to fifo
# @argument flag - [r, w, w+, ...
# @argument wait_on_str - continue if can read]
# @returns named_pipe -handle
def named_pipe( pipe_path, flag, wait_on_str=nil )
if File.exists? pipe_path
raise "bad #{pipe_path}" unless File.pipe? pipe_path
end
pipe_handle = File.mkfifo pipe_path

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@rickhull
rickhull / diceroll.rb
Created October 11, 2011 20:34 — forked from andrewhl/about_dice_project.rb
Ruby Koan
module DiceSet
def self.roll(num)
Array.new(num) { 1 + rand(6) }
end
end
DiceSet.roll(20)
@rickhull
rickhull / TextAnalyzer-Ref
Created September 21, 2011 18:50 — forked from stuckinthecloud/gist:1227555
Refractored TextAnalyzer
#!/usr/bin/ruby
# Text Analyzer
# Author: Zach
# Purpose: Utilize Ruby to analyze Text files
# and generate statistical information therein.
require 'cgi'
STOPWORDS = File.readlines('conf/stop_words.txt').map{|x| x.chomp}
#!/usr/bin/ruby
# Text Analyzer
# Author: Zach
# Purpose: Utilize Ruby to analyze Text files
# and generate statistical information therein.
require 'cgi'
STOPWORDS = File.read('conf/stop_words.txt').map{|x| x.chomp}
require 'socket'
require 'rubygems'
require 'nokogiri'
PORT = rand(65535 - 1024) + 1024
sthread = Thread.new {
s = TCPServer.new(PORT).accept
puts "[SERVER] Client connected."
module Delegator
def self.extended(into)
(class << into; self; end).send :attr_accessor, :delegates
into.delegates = []
into.send :define_method, :method_missing do |method, *args, &block|
self.class.delegates.map{|delegate| send(delegate) }.each do |receiver|
next unless receiver.respond_to?(method)
return receiver.send(method, *args, &block)
end