Skip to content

Instantly share code, notes, and snippets.

View korabh's full-sized avatar
🇽🇰

Korab Hoxha korabh

🇽🇰
View GitHub Profile
@xhezairbey
xhezairbey / beard_test.rb
Last active August 29, 2015 14:09
The Ruby Beard Test
# Pretty print your Ruby objects with style -- in full color and with proper indentation
# https://github.com/michaeldv/awesome_print
require 'awesome_print'
=begin
* Name: Beard Test App
* Description: Person Beard Scanner
* Author: @xhezairi & @korabh
* Date: Today
* License: MMV
@korabh
korabh / distance.rb
Last active August 29, 2015 13:58
# Calculate distance between two points.
# Google Direction API
include HTTParty
format :json
def api_key
# Your API key
end
def direciton_api_url
@jordanbyron
jordanbyron / authentication.rb
Last active January 2, 2019 21:06
Custom authentication strategy for Devise with login screens, routes, and no database_authenticatable - Full writeup: http://blog.jordanbyron.com/post/54013166913/devise-authentication-strategy-without
module AuthApp
class CustomAuthentication < Devise::Strategies::Authenticatable
# This check is run before +authenticate!+ is called to determine if this
# authentication strategy is applicable. In this case we only try to authenticate
# if the login and password are present
#
def valid?
login && password
end