This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= link_to 'Link to Nowhere', 'javascript:;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this if you only want to use the checkbox as a clicker | |
$('#checkbox-id').click -> | |
$('.what-you-want-to-hide').slideToggle('slow') | |
# Use this if you actually care about checking to see if the checkbox has been checked | |
$('#checkbox-id').click -> | |
if $(@).prop('checked') | |
$('.what-you-want-to-hide, .what-you-want-to-hide-also').slideDown 'slow' | |
else | |
$('.what-you-want-to-hide, .what-you-want-to-hide-also').slideUp 'slow' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# figaro gem | |
# config/application.yml | |
stripe_publishable_key: pk_test_TLr0qqdKhm0yX1bZtKC4kFAC | |
stripe_secret_key: sk_test_Qbppb2nkFEzPoquOdBym0JL2 | |
# rails 4.1 | |
# config/secrets.yml | |
stripe_publishable_key: pk_test_TLr0qqdKhm0yX1bZtKC4kFAC | |
stripe_secret_key: sk_test_Qbppb2nkFEzPoquOdBym0JL2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="first"> | |
<div id="second"> | |
Item you want centered | |
</div> | |
</div> | |
for example: | |
<a href="mailto:info@email.com?Subject=Web%20Page" target="_top" id="first"> | |
<img src="photo.png" alt="photo"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[data-link] { | |
cursor: pointer; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleForm.setup do |config| | |
config.input_class = 'form-control' | |
config.boolean_style = :nested | |
config.wrappers :bootstrap3, tag: 'div', class: 'form-group', error_class: 'has-error', | |
defaults: { input_html: { class: 'default_class' } } do |b| | |
b.use :html5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form-inputs"> | |
<%= f.input :title, :input_html => { :value => "This is title field value." } %> | |
<%= f.input :body, :input_html => { :value => "This is body field value." } %> | |
</div> | |
or | |
<div class="form-inputs"> | |
<%= f.input :title, input_html: { :value => "This is title field value." } %> | |
<%= f.input :body, input_html: { :value => "This is body field value." } %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
letter | frequency | |
---|---|---|
A | .08167 | |
B | .01492 | |
C | .02780 | |
D | .04253 | |
E | .12702 | |
F | .02288 | |
G | .02022 | |
H | .06094 | |
I | .06973 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SessionsHelper | |
def sign_in(user) | |
cookies.permanent[:remember_token] = user.remember_token | |
self.current_user = user | |
end | |
end | |
# You can use cookies as if it were a hash even though it's not as it's actually saves a piece of text on the bowser. | |
# Each element in the cookies is itself a hash of two elements, a value and an optional expires date. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devise_for :users, path_names: {sign_in: "login", sign_out: "logout"} |