Skip to content

Instantly share code, notes, and snippets.

View tolumide-ng's full-sized avatar

Tolumide Shopein tolumide-ng

  • Berlin, Germany
  • 15:15 (UTC +01:00)
View GitHub Profile
@tolumide-ng
tolumide-ng / fibonacci.rs
Last active July 12, 2020 20:03
Fibonacci Series with Rust
use std::io;
fn main() {
let mut number = String::new();
println!("\nEnter a positive integer: ");
io::stdin().read_line(&mut number)
.expect("Failed to read line");
:root {
--item-translate: 0px;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
// Initial
if (
this.initialTab === "createVendor" ||
this.initialTab === "vendor" ||
this.initialTab === "uploadVendor" ||
this.initialTab === "downloadVendor"
) {
return "vendor";
}
if (
@tolumide-ng
tolumide-ng / graphql twitter bearer token
Created January 25, 2020 17:48
getting bearer token from twitter oauth2.0
import { ResolverMap } from "../../types/graphql-utils";
import axios from "axios";
import dotenv from "dotenv";
const qs = require("qs");
dotenv.config();
export const resolvers: ResolverMap = {
Query: {
twitterLogin: async (_: any): Promise<any> => {
let bearerToken: string = "";
@tolumide-ng
tolumide-ng / postgresql_mac.md
Created January 16, 2020 13:15
Postgresql on Mac

Installing

Reference

brew update
brew install postgresql
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
@tolumide-ng
tolumide-ng / jwt-expiration.md
Created January 2, 2020 10:07 — forked from soulmachine/jwt-expiration.md
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

@tolumide-ng
tolumide-ng / Docker shell commands.sh
Created December 30, 2019 12:39 — forked from tomysmile/Docker shell commands.sh
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
@tolumide-ng
tolumide-ng / nigeria-state-and-lgas.json
Created December 29, 2019 17:11 — forked from PaulOnyekwelu/nigeria-state-and-lgas.json
Nigeria States and LGAs in one JSON file
[
{
"state": "Adamawa",
"alias": "adamawa",
"lgas": [
"Demsa",
"Fufure",
"Ganye",
"Gayuk",
"Gombi",
@tolumide-ng
tolumide-ng / README.md
Created October 23, 2019 09:49 — forked from greyscaled/README.md
Sequelize + Express + Migrations + Seed Starter
@tolumide-ng
tolumide-ng / node_nginx_ssl.md
Created September 23, 2019 14:27 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to Digital Ocean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user