Skip to content

Instantly share code, notes, and snippets.

View Abdulwahaab710's full-sized avatar
🇵🇸
Palestine will be free ✌🏽

Abdulwahaab Ahmed 🍉 Abdulwahaab710

🇵🇸
Palestine will be free ✌🏽
View GitHub Profile

Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

Steps

Keybase proof

I hereby claim:

  • I am abdulwahaab710 on github.
  • I am abdulwahaab710 (https://keybase.io/abdulwahaab710) on keybase.
  • I have a public key whose fingerprint is 676C 7AA8 9862 78F6 9582 7348 11FA 7638 A8E0 D1B0

To claim this, I am signing this object:

# Install bootstrap and source
# Install GIT and SSH
sudo apt-get update
sudo apt-get -y install git ssh
# Update .bashrc
cat >> ~/.bashrc <<EOF
export PYTHONPATH=/opt/al/pkg
source /etc/default/al
body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
@Abdulwahaab710
Abdulwahaab710 / waitForKeyElements.js
Created April 17, 2020 19:46 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);