Skip to content

Instantly share code, notes, and snippets.

View mrfoh's full-sized avatar

Patrick Foh Jr mrfoh

View GitHub Profile
@mrfoh
mrfoh / lagos
Created September 20, 2018 21:44
[
{ "lat": 6.70153,"lng": 3.2792 },
{ "lat": 6.65105,"lng": 3.26132 },
{ "lat": 6.60603,"lng": 3.25238 },
{ "lat": 6.52963,"lng": 3.22319 },
{ "lat": 6.4539,"lng": 3.10422 },
{ "lat": 6.40272,"lng": 3.14731 },
{ "lat": 6.39516,"lng": 3.34508 },
{ "lat": 6.39967,"lng": 3.40722 },
{ "lat": 6.42124,"lng": 3.45357 },
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//

Levelup Academy NodeJs 102 Assignment

  • Write an HTTP server that responds with a message saying "Hello World"
  • Write an HTTP server that returns a list of cities around the world when a HTTP request is made to it with a GET method, and a path of /cities. The server should also allow you make POST request with a path /cities and a body, and respond with the details of the request; it's headers, method, url and body.

Notes

  • Write your solutions on Repl.it
  • Share the link to your repl.it workspace here
## Assignment 1
Write a nodeJS server using ExpressJs that;
1. Serves the Timeoff frontend app when the "/" is request via a HTTP GET request
2. Add a route "/holidays" to the server that makes an external HTTP request to [Holiday API](https://holidayapi.com/) to get public holidays
for the current month in Nigeria.
Submit a link to your Timeoff project github repo [here!](https://forms.gle/b4vXNTBYTmnc66x5A)
Assignment
Fork this [repo](https://github.com/mrfoh/timeoff-backend) for the timeoff backend app, as this will serve a foundation for
the backend for your Timeoff application
1. Maintaining the current structure, create new migrations for the following tables;
a. users with the following columns; first_name, last_name, email, password, timestamps
b. requests; user_id, organization_id, employee_id, request_type(type of timeoff), start_date, end_date, status(status of the request), timestamps
2. Define models for the
@mrfoh
mrfoh / AndroidManifest.xml
Created July 27, 2019 12:59
Android phone broadcast receiver
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chronotechlabs.broadcastreceiver">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
@mrfoh
mrfoh / AndroidManifest.xml
Last active August 12, 2019 15:45
Android incoming call detector
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sample.broadcastreceiver">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
@mrfoh
mrfoh / personalize.js
Created March 14, 2021 10:53
Fix for code snippet in Silverfin Questionaire
const personalize_msg = (Name, _ending) => {
const ending = _ending || '.'
const message = "you are great"
return `${Name}, ${message}${ending}`
}
personalize_msg("Anonymous", '!')