Skip to content

Instantly share code, notes, and snippets.

View ortegacmanuel's full-sized avatar

Manuel Ortega ortegacmanuel

View GitHub Profile
@ortegacmanuel
ortegacmanuel / krommarghenoj.rb
Created June 27, 2018 14:59
Klarigo pri krommarĝenoj en la fontkodo de komputilaj programoj
# Hodiaŭ ni parolas pri krommarĝenoj en la kodado de komputilaj programoj.
#
# Krommarĝenoj en la fontkodo de komputilaj programoj estas tiuj kromaj spacetoj foje troviĝantaj komence de linioj
# kaj kiuj helpas vertikale organizi la fontkodon kaj faciligi ĝian legadon. Ni esploru la sekvan kodon:
se 5 == 4
eligu 'ili egalas'
male
eligu 'ili ne egalas'
fino
@ortegacmanuel
ortegacmanuel / book.rb
Last active March 22, 2018 01:43
Describes a Book object the can tell you how many times a word appears in it's content
# Module for operations with numbers
module Numbers
def self.prime?(num)
return false if num <= 1
(2..Math.sqrt(num)).none? { |i| (num % i).zero? }
end
end
# Describes a Book object the can tell you how
# many times a word appears in it's content