Skip to content

Instantly share code, notes, and snippets.

View rohitsthaa's full-sized avatar

Rohit Shrestha rohitsthaa

View GitHub Profile
@rohitsthaa
rohitsthaa / es_simple_autocomplete_example_config.sh
Created August 11, 2017 12:11 — forked from justinvw/es_simple_autocomplete_example_config.sh
Simple ElasticSearch autocomplete example configuration. The 'autocomplete' functionality is accomplished by lowercasing, character folding and n-gram tokenization of a specific indexed field (in this case "city").
# Delete the possibly existing autocomplete test index
curl -X DELETE localhost:9200/autocomplete_test
# Put the config of the autocomplete index
curl -X PUT localhost:9200/autocomplete_test -d '
{
"settings" : {
"index" : {
"analysis" : {
"analyzer" : {

#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