Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cdesch's full-sized avatar
🏠
Working from home

cdesch cdesch

🏠
Working from home
View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')
@gonecoding
gonecoding / Readme.markdown
Created February 22, 2011 12:42
Adding methods to NSData and NSString using categories to provide AES256 encryption on iOS

Important notice

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.

@thebigreason
thebigreason / social-sharing-alignment.html
Created October 18, 2011 17:48
Align Facebook Like, Twitter Tweet and Google +1 buttons
<div class="social">
<span class="twitter">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="[your-url-here]">Tweet</a>
</span>
<span class="google">
<g:plusone size="medium" href="[your-url-here]"></g:plusone>
</span>
<span class="Facebook">
<iframe src="https://www.facebook.com/plugins/like.php?href=[your-url-here]&amp;show_faces=false&amp;layout=button_count" scrolling="no" frameborder="0" style="height: 21px; width: 100px" allowTransparency="true"></iframe>
</span>
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#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)
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@developer88
developer88 / active_admin.rb
Last active March 19, 2016 20:18
This is my gist that show how we can use CanCan with ActiveAdmin and store permissions in database.
# 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
@Andrew8xx8
Andrew8xx8 / Gemfile
Created June 14, 2013 10:32
Example of API with ransack search and kaminari paginate.
gem 'kaminari'
gem 'ransack'
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@oliverbarreto
oliverbarreto / ObjectiveC Singleton
Last active December 27, 2015 09:39
Singleton Code for ObjectiveC iOS7
SingletonClass.h:
@interface SingletonClass : NSObject
@property (nonatomic, retain) NSString *myProperty;
+ (SingletonClass *)sharedInstance;
@end
SingletonClass.m:
@implentation
+ (SingletonClass *)sharedInstance