Skip to content

Instantly share code, notes, and snippets.

View bsaf's full-sized avatar

Basil Safwat bsaf

View GitHub Profile
@laurenfazah
laurenfazah / authentication_with_express_postgres.md
Last active November 8, 2022 01:51
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@bithive
bithive / totp.rb
Created May 23, 2011 23:19
Generate Google Authenticator codes in Ruby (requires base32 gem)
#!/usr/bin/env ruby
require 'rubygems'
require 'base32'
require 'openssl'
int = 30
now = Time.now.to_i / int
key = Base32.decode File.read('secret.key').strip