This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
#!/bin/bash | |
# Tells you how your photos are distributed over the year - in which months do you take the most photos? | |
# | |
# call with | |
# ./stats.sh 2>/dev/null | |
# because there will be some broken exif data | |
date | |
echo "Total photos:" |
require 'spec_helper' | |
# Bustle is a pubsub system used for activity streams: | |
# https://github.com/fredwu/bustle | |
# | |
# Here when a person follows another (or a discussion, for instance), the observer wires | |
# up pubsub between them for future activity notifications. The Follow model knows nothing | |
# about the implementation choices for the pubsub system. | |
describe FollowObserver do | |
subject { FollowObserver.instance } |
On Tue, Mar 12, 2013 at 1:26 PM, Martin Fowler [email protected] wrote:
The term pops up in some different places, so it's hard to know what it means without some context. In PoEAA I use the pattern Service Layer to represent a domain-oriented layer of behaviors that provide an API for the domain layer. This may or may not sit on top of a Domain Model. In DDD Eric Evans uses the term Service Object to refer to objects that represent processes (as opposed to Entities and Values). DDD Service Objects are often useful to factor out behavior that would otherwise bloat Entities, it's also a useful step to patterns like Strategy and Command.
It sounds like the DDD sense is the sense I'm encountering most often. I really need to read that book.
The conceptual problem I run into in a lot of codebases is that rather than representing a process, the "service objects" represent "a thing that does the process". Which sounds like a nitpicky difference, but it seems to have a real impact on how people us
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Single-Column Responsive Email Template</title> | |
<style> | |
@media only screen and (min-device-width: 541px) { | |
.content { |
require 'bundler/cli' | |
require 'git' | |
require 'octokit' | |
BRANCH_NAME = 'gem-updates' | |
COMMIT_MESSAGE = 'Update gems' | |
# ASSIGNEE = 'pengwynn' # update to assing pull request | |
git = Git.open(Dir.pwd) | |
github = Octokit::Client.new(access_token: ENV['GITHUB_ACCESS_TOKEN']) |
(function(d){ | |
var asin = d.getElementById('ASIN'), url; | |
if (asin) { | |
url = 'http://' + d.domain.split('.').slice(-2).join('.') + '/dp/' + asin.value; | |
if (prompt('Short Amazon URL (hit OK to load):', url)) { | |
window.location.href = url; | |
} | |
} else { | |
alert("Can't find an Amazon product ID."); |
Source: minitest/minitest#440 (comment)
kytrinyx commented on Jul 15, 2014 I would highly recommend separating out the two tests, and on the one hand asserting that your code handles the exception in the way you want it to, and on the other hand, that a collaborator calls the method that you expect it to call (without making assertions about what happens when it does).
Here's an example of the first type of test, using a stub:
class Cupcake
class SpectacularError < RuntimeError; end