Skip to content

Instantly share code, notes, and snippets.

View esteedqueen's full-sized avatar
😼

Esther Olatunde esteedqueen

😼
View GitHub Profile
@esteedqueen
esteedqueen / Gemfile
Created May 23, 2016 12:10 — forked from chocnut/Gemfile
iOS AC + Social(Facebook) Framework & Rails(omniauth-facebook)
gem 'devise'
gem 'omniauth-facebook'
@esteedqueen
esteedqueen / Redis Cloud overview.md
Created November 13, 2015 16:34 — forked from Yiftach/Redis Cloud overview.md
Heroku - Redis Cloud overview

Redis Cloud is a fully-managed service for running your Redis dataset. You can quickly and easily get your apps up and running with Redis Cloud through its add-on for Heroku, just tell us how much memory you need and get started instantly with your first Redis database. You can then add as many Redis databases as you need (each running in a dedicated process, in a non-blocking manner) and increase or decrease the memory size of your plan without affecting your existing data. You can easily import an existing dataset to any of your Redis Cloud databases, from your S3 account or from any other Redis server. Daily backups are performed automatically and in addition, you can backup your dataset manually at any given time.

Getting started

Start by installing the add-on:

:::term

$ heroku addons:add rediscloud

@esteedqueen
esteedqueen / filterable.rb
Created November 10, 2015 01:00 — forked from justinweiss/filterable.rb
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with the same name as the keys in <tt>filtering_params</tt>
# with their associated values. Most useful for calling named scopes from
@esteedqueen
esteedqueen / authenticable.rb
Last active December 7, 2022 08:52 — forked from Bomadeno/registrations_controller.rb
JSON API User Registration and Sessions with Devise
module Authenticable
# Devise methods overwrite
def current_user
@current_user ||= User.find_by(authentication_token: request.headers['Authorization'])
end
def authenticate_with_token!
render json: { errors: "Not authenticated" },
status: :unauthorized unless user_signed_in?