Skip to content

Instantly share code, notes, and snippets.

@NoahSaso
NoahSaso / AutoHook.h
Last active April 17, 2020 21:13 — forked from JohnCoates/AutoHook.h
Simple Objective-C Protocol Method Hooking
@protocol AutoHook <NSObject>
@required
+ (NSString *)targetProtocol;
@end
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
protect_from_forgery
private
def require_user
unless @current_user
store_location
flash[:notice] = "You must be logged in to access this page"
redirect_to login_url