Skip to content

Instantly share code, notes, and snippets.

View danoseun's full-sized avatar
💭
Learning

Seun Somefun danoseun

💭
Learning
View GitHub Profile
//encrypt
const encrypt = (salt, text) => {
const textToChars = (text) => text.split("").map((c) => c.charCodeAt(0));
const byteHex = (n) => ("0" + Number(n).toString(16)).substr(-2);
const applySaltToChar = (code) => textToChars(salt).reduce((a, b) => a ^ b, code);
return text
.split("")
.map(textToChars)
.map(applySaltToChar)
import 'dotenv/config';
import model from '../database/models'
import { Op } from 'sequelize';
import { comparePassword, hashPassword, checkPassword } from '../helpers/password';
import { findUserByEmail, registerEmailTemplate,
updatePassword, getUser, getUserById } from '../services/user'
import { emailTemplate, Transporter, getPasswordResetURL,
passwordResetEmailTemplate,
useUserDetailToMakeToken } from '../helpers/email';
import { convertParamToNumber } from '../helpers/util';
/** @class BaseService
* @property {Model} model - Sequelize Model
* @description
* Serves as an interface for database actions like FIND, UPDATE, DESTROY
* @example
* const roleService = new BaseService(db.Role)
*/
class DataService {
constructor(model) {
.search-form {
margin-left: auto;
margin-right: auto;
justify-content: center;
}
input {
width: 250px;
margin: 0;
font-family: inherit;
import React, { Component } from 'react';
import api from '../util/api';
import Card from '../components/Card';
import Row from '../components/Row';
import Container from '../components/Container';
import Column from '../components/Column';
import './index.css';
class Employee extends Component {
@danoseun
danoseun / System Design.md
Created July 5, 2020 14:34 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@danoseun
danoseun / vanilla-js-cheatsheet.md
Created October 13, 2019 08:09 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet