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
{ | |
"user": { | |
"debug": false, | |
"delay": 0.25, | |
"error_color": "D02000", | |
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme", | |
"gutter_theme_excludes": [], | |
"lint_mode": "background", | |
"linters": { | |
"eslint": { |
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
# Recursive sorting algorithm for Hash | |
class Hash | |
def sort_by_key(recursive = false, &block) | |
self.keys.sort(&block).reduce({}) do |seed, key| | |
seed[key] = self[key] | |
if recursive && seed[key].is_a?(Hash) | |
seed[key] = seed[key].sort_by_key(true, &block) | |
end | |
seed |
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
(end_date.year * 12 + end_date.month) - (start_date.year * 12 + start_date.month) + (end_date.day >= start_date.day ? 1 : 0) |
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 DoNotDisturb | |
def initialize | |
@desk = InformationDesk.new | |
end | |
def method_missing(name, *args) | |
unless name.to_s == "emergency" | |
hour = Time.now.hour | |
raise "Out for lunch" if hour >= 12 && hour < 14 | |
end |
NewerOlder