Skip to content

Instantly share code, notes, and snippets.

Awokoya Emmanuel EmmaAkin

Block or report user

Report or block EmmaAkin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SquareRoot_fast.rb
puts "Enter a number to find the square"
number = gets.chomp.to_i
puts "Enter the accepted error"
error = gets.chomp.to_i
def abs(firstNum,secNum)
if firstNum>secNum
firstNum-secNum
@EmmaAkin
EmmaAkin / isPrime.rb
Last active Sep 29, 2016
This is a ruby code that check if the number you typed is a prime using the fastest method ever. Hint! Use square root algorithm
View isPrime.rb
puts "Enter a number to to check"
number = gets.chomp.to_i
def abs(firstNum,secNum)
if firstNum > secNum
firstNum - secNum
else
secNum - firstNum
@EmmaAkin
EmmaAkin / product_of_array.rb
Last active Sep 29, 2016
Find the product of the elements in an Array without the element itself. [1,2,3], newArray = [6,3,2]
View product_of_array.rb
def product_of_elements_array(a)
i = 0
prod = 1
while i <= (a.length-1)
prod = prod * a[i]
i+=1
end
prod
end
@EmmaAkin
EmmaAkin / intersecting_rec..rb
Last active Oct 1, 2016
This contains a function that finds the intersecting vertices of two rectangles given the rectangles vertices as two arrays. The arrays are given such that the two first elements are the coordinate of the base point of the rectangle, while the third element is the breath and the last element is the height of the rectangle. Example a=[1,1,2,3] x=…
View intersecting_rec..rb
#The function find the intersection point of two lines
def intersect_rec(a, b)
#Function takes the coordinate of horizontal and vertical line #Return the coordinate of the intersection
intersect = []
if a.length !=4 and b.length !=4
return "You did not enter a rectangle vertices"
end
x1 = a[0]
x2 = a[0]+a[2]
y1 = a[1]
@EmmaAkin
EmmaAkin / adding_new_user_in_digital_ocean.md
Last active Nov 29, 2017
How to add a new user on your Ubuntu Digital Ocean Droplet from a Git Bash Windows System
View adding_new_user_in_digital_ocean.md

Adding a user to the System to allow control over the www.data (Web directory of your new droplet)

#############################################################

⋅⋅1. Log in to your server as the root user

`local$ ssh root@server_ip address e.g ssh root@204.55.34.84`

You can learn how to add SSH to your Windows's system from GIT BASH

@EmmaAkin
EmmaAkin / git_bash_ssh_auth_win_setup.md
Last active Nov 28, 2017
Setup and Test SSH Authentication from Scratch Git Bash on Windows 7
View git_bash_ssh_auth_win_setup.md

Setup SSH Authentication using GIT BASH on Windows

######################################################

This set is broken down into

  1. Generating a new SSH Key and Adding it to the ssh-agent

    Read more about SSH agent

    And read about Generating a new SSH key from Github help

View _brightness.scss
// Brightness math based on:
// http://www.nbdtech.com/Blog/archive/2008/04/27/Calculating-the-Perceived-Brightness-of-a-Color.aspx
$red-magic-number: 241;
$green-magic-number: 691;
$blue-magic-number: 68;
$brightness-divisor: $red-magic-number + $green-magic-number + $blue-magic-number;
@function brightness($color) {
// Extract color components
You can’t perform that action at this time.