Skip to content

Instantly share code, notes, and snippets.

View habeeb-salami's full-sized avatar

Habeeb Salami habeeb-salami

View GitHub Profile
@habeeb-salami
habeeb-salami / otpverify.js
Created January 21, 2021 03:17 — forked from theanam/otpverify.js
OTP verification without database, full sample source code
const otpGenerator = require("otp-generator");
const crypto = require("crypto");
const key = "verysecretkey"; // Key for cryptograpy. Keep it secret
function createNewOTP(phone){
// Generate a 6 digit numeric OTP
const otp = otpGenerator.generate(6, {alphabets: false, upperCase: false, specialChars: false});
const ttl = 5 * 60 * 1000; //5 Minutes in miliseconds
const expires = Date.now() + ttl; //timestamp to 5 minutes in the future
const data = `${phone}.${otp}.${expires}`; // phone.otp.expiry_timestamp
@habeeb-salami
habeeb-salami / _end-to-end-enc.js.md
Created September 22, 2020 00:49 — forked from therightstuff/_end-to-end-enc.js.md
Javascript / Node.js end-to-end encryption

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.16 on 2014-12-24.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.16 on 2014-12-24.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {