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
ZodiacAnimal = Data.define(:icon, :name, :chinese_name, :earthly_branch, :element, :trine, :yin) do | |
def self.all | |
[ | |
new( icon: "🐭", name: "Rat", chinese_name: "鼠", earthly_branch: "子", element: "Water", trine: 1, yin: false ), | |
new( icon: "🐂", name: "Ox", chinese_name: "牛", earthly_branch: "丑", element: "Earth", trine: 2, yin: true ), | |
new( icon: "🐅", name: "Tiger", chinese_name: "虎", earthly_branch: "寅", element: "Wood" , trine: 3, yin: false ), | |
new( icon: "🐇", name: "Rabbit", chinese_name: "兔", earthly_branch: "卯", element: "Wood" , trine: 4, yin: true ), | |
new( icon: "🐉", name: "Dragon", chinese_name: "龙", earthly_branch: "辰", element: "Earth", trine: 1, yin: false), | |
new( icon: "🐍", name: "Snake", chinese_name: "蛇", earthly_branch: "巳", element: "Fire" , trine: 2, yin: true ), | |
new( icon: "🐎", name: "Horse", chinese_name: "马", earthly_branch: "午", element: "Fire" , trine: 3, yin: false), |
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 Tag | |
def initialize(name, content = nil, **attributes, &block) | |
@name = name | |
@content = block_given? ? yield : content | |
@attributes = attributes | |
end | |
def to_s | |
"<#{@name}#{attributes}>#{@content}</#{@name}>" | |
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
*, *::after, *::before { | |
box-sizing: border-box; | |
} | |
body { margin: 0; } | |
[hidden] { display: none; } | |
h1 { font-size: 2rem; } | |
h2 { font-size: 1.5rem; } |
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
module Timer | |
module_function | |
def time unit = :microsecond | |
Process.clock_gettime(Process::CLOCK_MONOTONIC, unit) | |
end | |
def time_it start = time | |
yield | |
time_diff start |
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 Age | |
def initialize(dob) | |
@dob = dob | |
end | |
def now | |
at Time.now | |
end | |
def at(date) |
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 'delegate' | |
class NumberWithUnit < SimpleDelegator | |
def initialize(number, unit) | |
super number | |
@unit = unit | |
end | |
def to_s | |
"#{super}#{@unit}" |
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
Gem::Specification.new do |s| | |
s.name = 'phonetic' | |
s.version = '0.0.1' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Kevin Melchert' | |
s.email = '[email protected]' | |
s.summary = 'Papa - Hotel - Oscar - November - Echo - Tango - India - Charlie - Sierra - Papa - Echo - Lima - Lima - India - November - Golf' | |
s.description = 'Phonetic Spelling: NATO, LAPD and lots more' | |
s.files = ['phonetic.rb'] |
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
.DIN.A0 { width:841mm; height:1189mm; } | |
.DIN.A1 { width:594mm; height: 841mm; } | |
.DIN.A2 { width:420mm; height: 297mm; } | |
.DIN.A3 { width:297mm; height: 420mm; } | |
.DIN.A4 { width:210mm; height: 297mm; } | |
.DIN.A5 { width:148mm; height: 210mm; } | |
.DIN.A6 { width:105mm; height: 148mm; } | |
.DIN.A7 { width: 74mm; height: 105mm; } | |
.DIN.A8 { width: 52mm; height: 74mm; } | |
.DIN.A9 { width: 37mm; height: 52mm; } |
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 Attributes < Module | |
def initialize(*attr_names) | |
@attr_names = attr_names | |
define_method :attributes { attr_names } | |
end | |
private | |
def included(base) | |
super |
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
Gem::Specification.new do |s| | |
s.name = 'power-month' | |
s.version = '0.0.4' | |
s.platform = Gem::Platform::RUBY | |
s.author = 'Kevin Melchert' | |
s.email = '[email protected]' | |
s.summary = 'Month of Year.' | |
s.description = 'Super simple Month of Year implementation.' | |
s.files = ['month.rb'] |
NewerOlder