Skip to content

Instantly share code, notes, and snippets.

View monsieurkayode's full-sized avatar
💻
Working from home

Kayode Adeola monsieurkayode

💻
Working from home
  • HireArt
  • Nigeria
View GitHub Profile
@monsieurkayode
monsieurkayode / solid.rb
Last active September 3, 2019 08:02
Some examples of solid principle in code
=begin
SOLID Principles
----------------
SOLID stands for a set of acronym that are guiding designing principles that help developers to
write clean and maintainnable source code modeled using an object oriented programming language.
This gist breaks down and explains each of the principle with example implemenntation code in Ruby
S -> Single Responsibility Principle (SRP)
@monsieurkayode
monsieurkayode / search_algorithms.rb
Last active August 6, 2019 19:49
A base implementation code of common search algorithms
# Linear search implementation
# Iterates through all the elements in an Enumerable
# using a loop with a break condition and returns the index
# of the found element or -1
# Space time complexity: O(n)
# Probably the least efficient of search algorithms expecially when traversing through large datasets.
def linear_search(data_set, element)
index = 0
last_index = data_set.length - 1

Keybase proof

I hereby claim:

  • I am monsieurkayode on github.
  • I am monsieurkayode (https://keybase.io/monsieurkayode) on keybase.
  • I have a public key ASAeOGQsqdib41KgHqsixCDs2au7P7M2nhbwQyI7kwCK4Qo

To claim this, I am signing this object: