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 / fcm_push_notification.js
Created February 18, 2025 08:25
FCM Push Notifications with API only
const jwt = require('jsonwebtoken');
const axios = require('axios');
const fs = require('fs');
function getFCMAccessToken() {
const creds = JSON.parse(process.env.SERVICE_ACCOUNT_JSON || '{}');
const privateKey = creds.private_key.replace(/\\n/g, '\n');
const clientEmail = creds.client_email;
const scopes = ['https://www.googleapis.com/auth/firebase.messaging'];
const url = 'https://oauth2.googleapis.com/token';
@seunoyeniyi
seunoyeniyi / eee302_352_graphing.ipynb
Last active April 8, 2024 23:14
eee302_352_graphing.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@seunoyeniyi
seunoyeniyi / Fractal.py
Created May 18, 2023 20:23
Final Lab Assignment
#OYENIYI SEUN TAIWO
#CSC/2021/235
import turtle
import math
t = turtle.Turtle()
# this function draw a single perpendicular (vertical and horizontal 90 degree) line
def draw(x, y, length):
@seunoyeniyi
seunoyeniyi / CSC_2021_235.py
Created May 12, 2023 09:20
Scooter Rental Management
#OYENIYI SEUN TAIWO
#CSC/2021/235
class Scooter:
def __init__(self, rental_company, starting_fee, price_per_100m, available_distance):
self.rental_company = rental_company
self.starting_fee = starting_fee
self.price_per_100m = price_per_100m
self.available_distance = available_distance
@seunoyeniyi
seunoyeniyi / CSC_2021_235.py
Created May 12, 2023 08:32
Library Management with Python
#OYENIYI SEUN TAIWO
#CSC/2021/235
class Book:
def __init__(self, title, author, num_pages, book_type):
self.title = title
self.author = author
self.num_pages = num_pages
self.book_type = book_type
@seunoyeniyi
seunoyeniyi / Taxi_Cab.js
Created August 31, 2022 08:52 — forked from Lin4ipsum/Taxi_Cab.js
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
@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):