Skip to content

Instantly share code, notes, and snippets.

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

Eze Sunday ezesundayeze

🏠
Working from home
View GitHub Profile
import schedule from 'node-schedule';
const publishPost = (postId: string, isScheduled: boolean, dateTime: string) => {
if (isScheduled) {
let date = extractDateParam(new Date(dateTime));
const { year, month, hours, minutes, seconds } = date;
@ezesundayeze
ezesundayeze / rustserver.rs
Created September 1, 2023 07:58
A simple Rust based server with no framework
use std::net::{TcpListener, TcpStream};
use std::io::{Read, Write};
/// Handles an incoming client TCP stream.
///
/// # Arguments
///
/// * `stream` - The TCP stream for the connected client.
///
/// # Panics
[
{
"code": "044",
"bankName": "Access Bank Nigeria Plc"
},
{
"code": "063",
"bankName": "Diamond Bank Plc"
},
{
cbnCode bankName
044 Access Bank Nigeria Plc
063 Diamond Bank Plc
050 Ecobank Nigeria
084 Enterprise Bank Plc
070 Fidelity Bank Plc
011 First Bank of Nigeria Plc
214 First City Monument Bank
058 Guaranty Trust Bank Plc
030 Heritaage Banking Company Ltd
@ezesundayeze
ezesundayeze / auto-migrate-sequelize-from-models.md
Created September 23, 2020 14:51 — forked from glennposadas/auto-migrate-sequelize-from-models.md
How to auto generate migrations with Sequelize CLI from Sequelize models?

Reference: https://stackoverflow.com/a/59021807/3231194

It's 2020 and many of these answers no longer apply to the Sequelize v4/v5 ecosystem.

The one good answer says to use sequelize-auto-migrations, but probably is not prescriptive enough to use in your project. So here's a bit more color...

Setup

My team uses a [fork of sequelize-auto-migrations][1] because the original repo is has not been merged a few critical PRs. [#56][2] [#57][3] [#58][4] [#59][5]

.container{
background-color: pink;
}
.navigation> ul{
background-color: black;
color: white;
overflow: hidden;
list-style-type: none;
margin: 0;
padding: 0;
# everything in .env including this below
...
DB_HOST=db
DATASBASE=
...
#!/bin/bash
FROM python:3.7
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir /usr/src/app/
VOLUME /usr/src/app/
WORKDIR /usr/src/app/
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r requirements.txt
version: '3.7'
services:
web:
build: ./
command: 'gunicorn rave_api_manager.wsgi:application --bind 0.0.0.0:8000'
container_name: rave_api_web
volumes:
- './:/usr/src/app/'
ports:
- '8000:8000'
from django.contrib.auth.models import AbstractUser
class User(AbstractUser):
...