This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# undo: reverts the last command, as long as there is a registered handler | |
# for it. | |
# | |
# Usage: | |
# | |
# $ undo | |
# | |
# There are no options. | |
# | |
# There are by default registered handlers for the following commands: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'config/environment' | |
class EmailRenderer | |
class_inheritable_accessor :view_paths | |
self.view_paths = ["."] | |
def template | |
@template ||= initialize_template | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TagSubscription < ActiveRecord::Base | |
belongs_to :delivery_strategy | |
end | |
class DeliveryStrategy < ActiveRecord::Base | |
# Attributes: | |
# type: can be 'real_time', 'daily' or 'weekly' | |
# day: contain the day of the week | |
# time: the time of the day (morning, afternoon, night) | |
# | |
has_many :tag_subscriptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Word-frequency. | |
# Usage: | |
# | |
# $ wf [-ni] file.txt [file1.txt file2.txt ...] | |
# | |
# You can choose to display just the first [n] most frequent words. | |
# | |
# $ wf -n2 file.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# repeat.sh | |
# | |
# Usage: | |
# repeat <command> | |
# will repeat <command> forever. | |
# | |
# repeat -nN <command> | |
# will repeat <command> N times. |