Skip to content

Instantly share code, notes, and snippets.

View Sammuel09's full-sized avatar

Samuel Adeniran Sammuel09

View GitHub Profile
function validatateAgeBelow18 (value){
// value is the user chosen date
// get today's date
var todaysDate = Date.now()
var todaysDateInSeconds = Math.floor(todaysDate/1000);
console.log("todaysdate", todaysDateInSeconds);
// convert to epoch time
// comvert to seconds.
// get date user choose
var userDate = value;
module.exports = {
root: true,
env: {
node: true,
jest: true,
},
extends: [
"eslint:recommended",
{
"compilerOptions": {
"allowJs": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"experimentalDecorators": true,

FWIW: I'm not the author of the content presented here (which is an outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@Sammuel09
Sammuel09 / Testing on Staging.md
Created June 8, 2020 08:11
This gist contains steps on how to access staging-test and check changes
  • git checkout master
  • git pull origin master
  • git checkout staging-test
  • git reset --hard origin/master // this resets the branch to have the latest changes of master
  • git add [my changes]
  • git commit -m "Describe my changes"
  • git push -f origin staging-test

When you are done with staging: I should be within the staging-test branch here

@Sammuel09
Sammuel09 / main.go
Last active July 10, 2020 14:04
This is a reverse-proxy server for statement backend
package main
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
@Sammuel09
Sammuel09 / staging.md
Last active March 11, 2020 21:50
This gist explains how to take staging, make some experimental changes and then revert changes
  • git checkout master
  • git pull origin master
  • git checkout staging-test
  • git reset --hard origin/master // this resets the branch to have the latest changes of master
  • git add [my changes]
  • git commit -m "Describe my changes"
  • git push -f origin staging-test

When you are done with staging: I should be within the staging-test branch here

// source: all.proto
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
@Sammuel09
Sammuel09 / index.js
Created January 16, 2019 12:54
Index file of Routes folder
import { Router } from 'express';
import userRoutes from './api/user';
const routes = Router();
routes.use(userRoutes);
export default routes;
import { Router } from 'express';
import UserController from '../../controllers/UserController';
const userRoutes = Router();
userRoutes.post('/auth/signup', UserController.signupUser);
export default userRoutes;