Skip to content

Instantly share code, notes, and snippets.

View somebox's full-sized avatar
🪩
driving LEDs

Jeremy Seitz somebox

🪩
driving LEDs
View GitHub Profile
@somebox
somebox / interview-engineers.md
Last active October 23, 2024 15:25
Interviewing Engineers

Note: This is an opinionated guide. While it is most effective for on-site, the same pattern can work with remote candidates.

How To Interview Engineers

Interviewing is hard. It's not easy to find good people, and once you do, it's often difficult to find out what they can do and how they work. A badly-run interview can pass over a great engineer. Conversely, some engineers are good at passing traditional tech interviews, but bring major problems with work habits or team fit.

The first priority of any manager is to hire the best people. Everything else must wait.

Screening

@somebox
somebox / why_utc.md
Last active March 9, 2016 11:09
Why use UTC for DB, APIs, Services... in Switzerland?
  • UTC is best practice http://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices
  • DST changes can causes issues with things like opening hours, publication dates on contracts, etc... UTC helps avoid this
  • embrace the pattern: UTC on systems and APIs, TZ display in UI/UX and outputs
  • integrations with partners, 3rd-party services (think Amazon, Google Cloud computing, pub/sub services, filepicker... all will use UTC)
  • you trade "easier to think about" for "subtle bugs and weird test fails" in the future
  • people assuming we're standard UTC like the rest of the world might set up servers/services in CEST and be off by an hour (past example: localina!)
  • someday you will work for a company that does things outside of Switzerland. You should learn this :)
@somebox
somebox / music-dsl.rb
Last active August 29, 2015 14:22
music dsl in ruby idea
# song definition
tempo 120
# bassline
instrument :bass, channel: 2 do
preset 'bass/fender_jazz_clean'
end
@somebox
somebox / osx-setup.sh
Last active December 11, 2021 13:05 — forked from foz/osx-setup.sh.md
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
@somebox
somebox / presenters.md
Last active March 26, 2022 02:12
Thoughts About Rails Presenters

Thoughts about Rails Presenters

This is a collection of links, examples and rants about Presenters/Decorators in Rails.


The "Decorator" pattern slowly started gaining popularity in Rails several years ago. It is not part of core Rails, and there's many different interpretations about how it should work in practice.

Jay Fields wrote about it in 2007 (before he switched back to Java and then Clojure): http://blog.jayfields.com/2007/03/rails-presenter-pattern.html

@somebox
somebox / unicorn-graphite.rb
Created November 12, 2013 13:03
Graphing unicorn active/queued processes (via sockets)
#!/usr/bin/env ruby
require 'rubygems'
require 'raindrops'
require 'statsd'
#
# This script monitors the active and queued unicorn processes.
# It uses the raindrops gem to look at the unix domain socket.
# Stats are polled every second (for one minute) and pushed to
# statsd as a counter. This script runs once a minute.
@somebox
somebox / redis-graphite.sh
Last active July 18, 2016 00:37
graphite-redis : monitor redis statistics with graphite across several hosts
#!/usr/bin/env ruby
require 'socket'
# This script runs every minute, captures stats about redis
# and forwards them to graphite as counter values.
# Graphite/carbon settings
GRAPHITE_HOST="graphite.intra.local.ch"
GRAPHITE_PORT=8125
>> h={a:true,b:false,c:1}
=> {:a=>true, :b=>false, :c=>1}
>> h[:a].present?
=> true
>> h[:a].presence
=> true
>> h[:b].present?
=> false
>> h[:b].presence
=> nil
@somebox
somebox / i18ndocs.diff
Created May 9, 2012 06:32
i18ndocs changes
diff --git a/Gemfile b/Gemfile
index 34fced8..7edff29 100644
--- a/Gemfile
+++ b/Gemfile
@@ -16,6 +16,8 @@ group :development do
gem "bundler", ">= 1.0.0"
gem "jeweler", ">= 1.8.3"
gem "simplecov",">= 0.5"
+ gem "fastercsv"
+ gem "i18n"
@somebox
somebox / application_controller.rb
Created May 3, 2012 11:51
rescue from routing errors
rescue_from ActionController::RoutingError do |exception|
render :file => Rails.root.join('public', '404.html'), :status => "404", :layout=>false
end