Skip to content

Instantly share code, notes, and snippets.


Yves-Eric Martin yemartin

  • MediWeb, Inc.
  • Tokyo, Japan
View GitHub Profile
View gist:560947bc4e85306f0c99
commit f6d3cbbb549fa1a2db898674e71bcf7890eee87c
Author: Yves-Eric Martin <>
Date: Thu Jul 10 16:20:25 2014 +0900
Add note about :new_records_only and UTC (Rails default) databases.
diff --git a/Documentation.textile b/Documentation.textile
index 15587b2..6d49bdd 100644
--- a/Documentation.textile
+++ b/Documentation.textile
yemartin / pbhighlight
Created Jun 17, 2015
Highlight code snippet in the clipboard, making it ready to be pasted into keynote.
View pbhighlight
# Dependency: highlight (
# $ brew install highlight
# Usage:
# 1. Copy some code snippet into the clipboard.
# 2. $ pbhighlight [syntax] # syntax parameter is optional. Default set below.
# 3. Paste into Keynote.
View where_is_waldo.rb
require 'active_support/all'
@store =
def my_hash
@store[:foo] ||= {bar: 'BAR'}
my_hash[:waldo] = 'WALDO'
my_hash[:baz] = 'BAZ'
yemartin / quick_web_automation.rb
Created Nov 2, 2016
Quick and dirty use of Capybara against a live site, for automation or smoke tests.
View quick_web_automation.rb
#!/usr/bin/env ruby
OPEN_TIME = "07:45"
PATIENT_NUMBER = '1111111'
require 'time'
require 'capybara'
require 'selenium-webdriver'
yemartin / public_protected_private.rb
Created Sep 7, 2018
Public, protected and private methods in Ruby
View public_protected_private.rb
# Note about `protected`:
# One use case for using `protected` is object comparator methods, where the method
# may need to call protected methods on `self` and another object of the same class.
# But 99% of the time, we don't write object comparator methods, that's why we almost
# Never use `protected`. See:
# See
class MyClass
# Internal Visibility / Implicit Receiver
yemartin /
Last active Dec 5, 2018 — forked from sj26/
Run MailCatcher in the background, always, on OS X

Run mailcatcher on startup, chruby version

Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist. Adjust the ruby version according to your environment.

You can’t perform that action at this time.