Class names are CamelCase
.
Methods and variables are snake_case
.
Methods with a ?
suffix will return a boolean.
#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
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"
A "Parallels Tools" CD will popup on your Ubuntu desktop.
Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"
Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed
)
Make command line installer executable (chmod +x install
)
Change directory to "installer" (cd installer
)
Make few other scripts executable: chmod +x installer.* *.sh prl_*
constructor(props) {
super(props);
this.state = {
height: window.innerHeight,
message: 'not at bottom'
};
this.handleScroll = this.handleScroll.bind(this);
}
First, install the required software:
geth.exe --dev --ipcpath geth.ipc console
class SetupHstore < ActiveRecord::Migration | |
def self.up | |
enable_extension "hstore" | |
end | |
def self.down | |
disable_extension "hstore" | |
end | |
end |
namespace :rabbit do | |
def get_queues | |
`#{@base_command} list queues | awk '{print$4}' | grep -vw '|' | grep -vw 'name' | awk 'NF'` | |
end | |
def get_queues_with_count | |
`#{@base_command} list queues | awk '{print$18, $4}' | grep -vw '|' | grep -vw 'name' | awk 'NF'` | |
end |
package main | |
import ( | |
"database/sql" | |
"gopkg.in/gorp.v1" | |
"log" | |
"strconv" | |
"github.com/gin-gonic/gin" | |
_ "github.com/go-sql-driver/mysql" |