Skip to content

Instantly share code, notes, and snippets.

View 907th's full-sized avatar

Aleksei Chernenkov 907th

View GitHub Profile
@palkan
palkan / gist:44837275114d66a24df4
Created December 1, 2014 12:32
[ruby] cyrillic detection becnh
class TestCyrillic
class << self
RUSSIAN_CODES = (1040..1103).to_a + (32..64).to_a + (91..96).to_a + (123..126).to_a + [1025, 1105, 8470]
def cyrillic?(string)
result = true
string.force_encoding("UTF-8").each_char{|c| result &&= RUSSIAN_CODES.include?(c.ord)}
result
end
@chetan
chetan / yardoc_cheatsheet.md
Last active April 16, 2024 23:49
YARD cheatsheet