Skip to content

Instantly share code, notes, and snippets.

View adham90's full-sized avatar
🤖
running...

Adham EL-Deeb adham90

🤖
running...
View GitHub Profile
@adham90
adham90 / 0_reuse_code.js
Created June 2, 2017 22:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@adham90
adham90 / authentication.rb
Created July 12, 2016 09:02 — forked from jnunemaker/authentication.rb
a starting point for authentication with mongomapper and rails
# include this in application controller
module Authentication
protected
# Inclusion hook to make #current_user and #signed_in?
# available as ActionView helper methods.
def self.included(base)
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method
end
# Returns true or false if the user is signed in.