Skip to content

Instantly share code, notes, and snippets.

View sl4m's full-sized avatar
😎
😎

skim sl4m

😎
😎
View GitHub Profile
@sl4m
sl4m / 2011-09-29-why-you-dont-get-mock-objects.md
Created September 29, 2011 18:21 — forked from jasonrudolph/2011-09-29-why-you-dont-get-mock-objects.md
RubyConf 2011: Why You Don't Get Mock Objects

"Why You Don't Get Mock Objects" by Gregory Moeck

RubyConf 2011 | 2011-09-29 | Gregory Moeck (@gregmoeck)

  • Recommended as the best book on mocks: Growing Object-Oriented Software, Guided by Tests by Steve Freeman & Nat Pryce
  • Common arguments against mocks
    • They duplicate implementation
    • They lead to brittle tests
  • Mock objects + procedural programming = bad idea
  • If you're doing traditional Rails development (which tends to follow more of a "procedural", do-this-and-then-do-that style), mock objects probably aren't for you
@sl4m
sl4m / about.md
Last active December 11, 2015 15:38 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
// need to mess with document.defaultAction = true/false to block default action;
// idea from http://www.quirksmode.org/js/keys.html
window.onload = function () {
var keyCodeUp,
keyCodeDown,
currentIndex,
fonts,
currentFont,
setGlobalFont,
@sl4m
sl4m / mice.css
Created September 10, 2010 16:16 — forked from jeffkreeftmeijer/mice.css
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
(ns sieve
(:use clojure.test))
(defn square [x] (* x x))
(defn seq-contains? [ls x]
(boolean (some #(= x %) ls)))
(defn multiple-of? [product divisor]
(and (= 0 (mod product divisor))