- Get crazy amazing fresh-roasted coffee beans delivered to your house from Tonx
- Grams rule everything around me - measure them beans: Jennings CJ4000 Digital Scale
- Get that good grind: Baratza Encore Conical Burr Coffee Grinder
- Get that fresh in your magical pour-over device: Hario V60 02 Coffee Dripper
- Add 200-degree water slooooow and precise: Bonavita 1-Liter Variable Temperature Digital Electric Gooseneck Kettle
- Into a mug for one person, or for two: Hario XGS-60TB V60 Range Server 600Ml
- You can get a lot of this stuff from the
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is an awk script, but no awk colour coding is available here. | |
# | |
# input: an LDAP query pulling back the displayName and sAMAccountName properties | |
# for an entire ActiveDirectory forest | |
# | |
# output: yaml format of same data | |
# ex. | |
# 1: | |
# name: "Doll, Brian A" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Marcel Molina's REST/CRUD conventions | |
# http://project.ioni.st/post/2283#snippet_2283 | |
class ApplicationController < ActionController::Base | |
def self.set_resource(resource, &custom_setter) | |
filter_name = :"set_#{resource}" | |
before_filter filter_name, :only => [:show, :edit, :update, :destroy] | |
if custom_setter | |
define_method(filter_name) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
domains = {} | |
ARGF.each do |email| | |
domain = email.split("@").last.strip | |
if domains[domain] | |
domains[domain] += 1 | |
else | |
domains[domain] = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add unique header support to soap4r clients | |
# http://emphaticsolutions.com/index.php/2008/05/06/soap-headers-per-request-in-ruby/ | |
# | |
require 'soap/header/handlerset' | |
class SOAP::Header::HandlerSet | |
# resets the internal handler store to an empty representation | |
def reset | |
@store = XSD::NamedElements.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rss/1.0' | |
require 'rss/2.0' | |
require 'open-uri' | |
require 'socket' | |
module ApplicationHelper | |
def render_rss_feed(url) | |
content = "" | |
open(url, 0) do |s| content = s.read end | |
feed = RSS::Parser.parse(content, false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%ruby script/console | |
Loading development environment (Rails 2.1.0) | |
>> (Time.now + 30.minutes).class | |
=> Time | |
>> 30.minutes.from_now.class | |
=> ActiveSupport::TimeWithZone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%- cache "statulous_blog", (Time.now + 60.minutes) do -%> | |
<%= render_rss_feed("http://statulous.blogspot.com/feeds/posts/default?alt=rss") %> | |
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h3><a href='<%= @link %>'><%= @title %>:</a></h3> | |
<small>The most recent 5 entries:</small><br/> | |
<% @items.each do |item| %> | |
<li><strong><a href='<%= item.link %>'><%= item.title %></a></strong> - <small>(<%= item.date.strftime('%m/%d/%Y') %>)</small> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void testSnappyHappy() { | |
Map snappy = null; | |
Map happy = new HashMap(); | |
addToMap(snappy, "foo", "bar"); | |
addToMap(happy, "foo", "bar"); | |
} | |
private Map addToMap(Map map, String key, String value){ | |
if (map == null){ |
OlderNewer