Skip to content

Instantly share code, notes, and snippets.

View seunoyeniyi's full-sized avatar
🏠
Working from home

Seun Oyeniyi seunoyeniyi

🏠
Working from home
View GitHub Profile
@seunoyeniyi
seunoyeniyi / simple-calculator.py
Created March 28, 2022 17:28
Simple Calculator with Python
# addition function
def add(x, y):
return x + y
# subtraction function
def subtract(x, y):
return x - y
# multiplication function
def multiply(x, y):
<?php
class Router
{
private $request;
private $supportedHttpMethods = array(
"GET",
"POST"
);
@Lin4ipsum
Lin4ipsum / Taxi_Cab.js
Created June 26, 2012 17:35
Taxi Cab Fare Calculator in JS
// use taxiFare to set tripCost to the cost of your
// ride covering 5 miles at 2 am in the morning
var tripCost = taxiFare(5, 2);
// calculates taxi fare based upon miles traveled
// and the hour of the day in military time (0-23).
var taxiFare = function (milesTraveled, pickupTime) {
var baseFare = 2.50;
var costPerMile = 2.00;
var nightSurcharge = 0.50; // 8pm to 6am, every night