Skip to content

Instantly share code, notes, and snippets.

View yemartin's full-sized avatar

Yves-Eric Martin yemartin

View GitHub Profile
@yemartin
yemartin / gnucash_easy_stylesheet_custom.css
Last active July 1, 2023 03:08
CSS customization of the Easy invoice stylesheet in GnuCash 5.x
h3, a, body, p, table, tr, td, th.column-heading-left, th.column-heading-center, th.column-heading-right, td.anchor-cell, td.number-cell, td.number-header, td.text-cell, td.total-number-cell, td.total-label-cell, td.centered-label-cell { font-family: "Hiragino Sans", "MS Gothic", "Meiryo", sans-serif; font-size: 14pt; }
table, thead, tbody, tfoot, tr, td { border-collapse: collapse; }
body > table, .main-table > table { width: 471pt; }
.div-align-right { float: right; }
.div-align-right .maybe-align-right { text-align: right }
.main-table > table > tbody > tr:first-child td::before { content: "Invoice Number: "; font-size: large; } .main-table > table > tbody > tr:first-child td { text-align: right; padding: 0; }
.invoice-title { font-size: large; display: inline-block; }
.invoice-title::first-letter { color: red !important; font-size: 0; }
.invoice-details-table { margin-right: -1px; }
.invoice-details-table > table * { padding: 0px; }
@yemartin
yemartin / README.md
Last active December 5, 2018 07:30 — forked from sj26/README.md
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.

@yemartin
yemartin / public_protected_private.rb
Created September 7, 2018 03:19
Public, protected and private methods in Ruby
# 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 http://tenderlovemaking.com/2012/09/07/protected-methods-and-ruby-2-0.html
class MyClass
# Internal Visibility / Implicit Receiver
@yemartin
yemartin / quick_web_automation.rb
Created November 2, 2016 01:19
Quick and dirty use of Capybara against a live site, for automation or smoke tests.
#!/usr/bin/env ruby
OPEN_TIME = "07:45"
TARGET_SITE = "http://example.com/"
PATIENT_NUMBER = '1111111'
require 'time'
require 'capybara'
require 'selenium-webdriver'
@yemartin
yemartin / where_is_waldo.rb
Created September 1, 2015 10:08
Where is Waldo?
require 'active_support/all'
@store = ActiveSupport::HashWithIndifferentAccess.new
def my_hash
@store[:foo] ||= {bar: 'BAR'}
end
my_hash[:waldo] = 'WALDO'
my_hash[:baz] = 'BAZ'
@yemartin
yemartin / pbhighlight
Created June 17, 2015 09:42
Highlight code snippet in the clipboard, making it ready to be pasted into keynote.
#!/bin/bash
#
# Dependency: highlight (http://www.andre-simon.de/doku/highlight/en/highlight.php)
# $ 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.
#
commit f6d3cbbb549fa1a2db898674e71bcf7890eee87c
Author: Yves-Eric Martin <yemartin@mediweb.jp>
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