Skip to content

Instantly share code, notes, and snippets.

@jbbarth
Created March 16, 2016 05:50
Show Gist options
  • Save jbbarth/6a8c72b987feca15f837 to your computer and use it in GitHub Desktop.
Save jbbarth/6a8c72b987feca15f837 to your computer and use it in GitHub Desktop.
Blog post test
def notify(msg):
print "NOTIFY: {}".format(msg)
def process():
#...
notify = False
if notify:
# take action
print "processing!"
#...
def expensive(foo):
if not hasattr(expensive, "_cached"):
expensive._cached = process_expensive_computation()
return epensive._cached
def expensive()
@expensive ||= process_expensive_computation()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment