Skip to content

Instantly share code, notes, and snippets.

Avatar
🏍️

Edwin Rozario EdwinRozario

🏍️
View GitHub Profile
View atbash.md

Atbash is a simple substitution cipher possible with any known alphabet. It emerged around 500-600 BCE. It works by substituting the letters of an alphabet with another.

Assumptions

English alphabets in order is the constant.

CONSTANT = 'abcdefghijklmnopqrstuvwxyz'

A random shuffle of the constant is the ciper.

Example cipher: zyxwvutsrqponmlkjihgfedcba

View regex_question
Axe activated rune INVISIBILITY
Rikki Maru activated rune DOUBLEDAMAGE
Axe and Rikki Maru are the name of DOTA2 character names
INVISIBILITY and DIUBLEDAMAGE are the names of runes
Challenge
1. Select the name of the character from the log.
2. Select the name of the character from the log.
View methode_missing_ex.rb
class Foo
MYMETHODS = ['van', 'car', 'bus']
def foo(x)
case x
when 'van' then return 'Long vehicle'
when 'car' then return 'Small vehicle'
when 'bus' then return 'Very Long vehicle'
else return 'None'
View colorize.rb
class String
#
# Colors Hash
#
COLORS = {
:black => 0,
:red => 1,
:green => 2,
:yellow => 3,
View String Array Sort
class StrArraySort
attr_accessor :list
def initialize(list)
@list = list
end
def get_the_least_word list
mark = list[0].to_s