Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
SingletonClass.h: | |
@interface SingletonClass : NSObject | |
@property (nonatomic, retain) NSString *myProperty; | |
+ (SingletonClass *)sharedInstance; | |
@end | |
SingletonClass.m: | |
@implentation | |
+ (SingletonClass *)sharedInstance |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
gem 'kaminari' | |
gem 'ransack' |
# config/initializers/active_admin.rb | |
ActiveAdmin.setup do |config| | |
config.current_user_method = :current_user | |
config.authentication_method = :authenticate_user! | |
config.before_filter :admin_role_filter | |
end | |
# Adding all recource names to Permissions table after ActiveAdmin is loaded |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
I took down this Gist due to concerns about the security of the encryption/decryption part of this code (see comments below).
Rob Napier (@rnapier) has created a publicly available class that provides similar AES encryption/decryption functionality at https://github.com/rnapier/RNCryptor.
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |