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
#fade { | |
width: 100px; | |
height: 100px; | |
border-radius: 50%; | |
border: none; | |
} |
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
img { | |
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
#!/usr/bin/ruby | |
# | |
# This script fixes /usr/local only. | |
# | |
# 6th January 2010: | |
# Modified the script to just fix, rather than install. - rpavlik | |
# | |
# 30th March 2010: | |
# Added a check to make sure user is in the staff group. This was a problem | |
# for me, and I think it was due to me migrating my account over several |
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
<ul class="left"> | |
<% if user_signed_in? %> | |
<li><%= link_to "Home Page", root_path %></li> | |
<% elsif admin_signed_in? %> | |
<li><%= link_to "Home Page", root_path %></li> | |
<li><%= link_to "Admin Home Page", admin_path %></li> | |
<% elsif company_user_signed_in? %> | |
<li><%= link_to "Home Page", root_path %></li> | |
<li><%= link_to "Company Home Page", company_path %></li> | |
<% else %> |
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
# Create this new controller for registrations to check that they're not already registered | |
class RegistrationsController < Devise::RegistrationsController | |
def new | |
if (user_signed_in? || admin_signed_in?) | |
redirect_to '/', alert: "You cannot register two roles at the same time!" | |
else | |
super | |
end |
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"} |
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
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
<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
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 |
OlderNewer