Skip to content

Instantly share code, notes, and snippets.

View somebox's full-sized avatar
⌨️
coding nights

Jeremy Seitz somebox

⌨️
coding nights
View GitHub Profile
@somebox
somebox / convert_trac.rb
Created October 10, 2010 20:31
Convert Trac Wiki to Markdown
#!/usr/bin/env ruby
# Convert Trac DB Wiki pages to Markdown source files
# This script is based on http://github.com/seven1m/trac_wiki_to_github which
# converted all pages from a Trac DB to GitHub Wiki format (as Textile).
#
# I made two changes:
# - uses MarkDown format instead
# - uses the sqllite3-ruby gem which does not need Ruby 1.9
@somebox
somebox / gh-like.css
Created July 14, 2011 14:55
github markdown css+script with syntax highlighting. Works with http://markedapp.com
/*
Some simple Github-like styles, with syntax highlighting CSS via Pygments.
*/
body{
font-family: helvetica, arial, freesans, clean, sans-serif;
color: #333;
background-color: #fff;
border: none;
line-height: 1.5;
margin: 2em 3em;
@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 / domain-driven-desire-resources.md
Last active February 10, 2022 14:55
Domain-Driven Desire: Further Reading

Domain-Driven Desire: The Talk from Øredev 2016

🎥 https://vimeo.com/191051851

Links and References

Thanks for watching my talk, Domain-Driven Desire at Øredev 2016. Here's a list of resources that inspired me, and will hopefully inspire you:

Videos

@somebox
somebox / why-not-to-cache.md
Created February 13, 2017 15:22
Why NOT to Cache

Why NOT to Cache

I’ve worked over the years on a lot of projects, with many teams. Frontend, backend, mobile, and so forth. One topic that always comes up - caching. Developers love to talk about the topic, and are excited to add seemingly low-cost performance enhancers to their architecture and code base. However, as Martin Fowler and many others have pointed out, caching is evil. It’s one of the hardest problems in computer science to solve.

The typical pattern is to take a slow request - say, an API response - and store it in a local cache (perhaps to disk, or Redis). The implementation goes like this: the simple approach is to do a get/set cache lookup. When the user needs the data, check if it’s in the cache. If it’s not, or it has expired, then fetch the latest value and store it in the cache.

For apps, one side effect of this approach is degraded experience for some small group of users. For example, a web app needs to access a slow resource that takes 2 seconds to respond. With caching used, tha

@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 / interview-engineers.md
Last active April 12, 2021 13:52
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

#include <Arduino.h>
#include "ESP8266WiFi.h"
#include "SPI.h"
#include <NTPClient.h>
#include <WiFiUdp.h>
/*
A large four digit 7-segment LED clock, controlled by an ESP8266.
The LED modules are quite large, 5" tall, and require high voltage to drive the many
@somebox
somebox / nginx.conf
Created March 13, 2012 16:19
Nginx error page handling
# The following recipe works with upstream rails proxy for custom 404s and 500s.
# Errors are usually handled via rails except if proxy is really down, in which case
# nginx needs a bit more configration.
server {
# ...
location / {
error_page 404 = @rails; # let rails show a page with suggestions
try_files maintenance.html @rails;
@somebox
somebox / ricardo-learning.md
Last active March 10, 2018 10:45
Learning Resources