Skip to content

Instantly share code, notes, and snippets.

View devrieda's full-sized avatar

Derek DeVries devrieda

View GitHub Profile

Keybase proof

I hereby claim:

  • I am devrieda on github.
  • I am devrieda (https://keybase.io/devrieda) on keybase.
  • I have a public key ASDiOAAZudDRTAZ1Oevgc5cQX3HVQ3g-L0eIn5AGnglIYwo

To claim this, I am signing this object:

The regex patterns in this gist are intended to match any URLs,
including "mailto:foo@example.com", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
@devrieda
devrieda / gist:8582591
Created January 23, 2014 17:08
Chapter 12
# Test "one level back"
# write tests at a single public method for changes in a number of private methods
# add higher level tests as a step towards unit tests
# Interception Points
# "a point where you can detect effects of a particular change"
# ----
# Identify where you need to make change, start tracing effects outwards
@devrieda
devrieda / gist:8043128
Last active December 31, 2015 20:49
Working effectively with Legacy Code Chapter 7: It Takes Forever to Make a Change
# Sprout Method
class TransactionGate
def post_entries(entries)
entries.each do |entry|
entry.post_date!
end
transaction_bundle.get_list_manager.add(entries)
end
end