Skip to content

Instantly share code, notes, and snippets.

View carmelyne's full-sized avatar
🏡
Working from home

Carmelyne Thompson carmelyne

🏡
Working from home
View GitHub Profile
#############
# Colors #
#############
# Set prompt: " username@hostname/directory/tree $ " (with colors)
export PS1=" \[\e[32;1m\]\u\[\e[0m\]\[\e[32m\]@\h\[\e[36m\]\w \[\e[33m\]\$ \[\e[0m\]"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontscolors PUBLIC "-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN"
"http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd">
<fontscolors>
<fontcolor bgColor="darkGray" name="guarded"/>
<fontcolor foreColor="yellow" name="caret-color-insert-mode"/>
<fontcolor bgColor="ff121e31" foreColor="white" name="status-bar"/>
<fontcolor bgColor="ff253e5a" name="highlight-caret-row"/>
<fontcolor foreColor="ffcccccc" name="line-number"/>
<fontcolor bgColor="ffe0e8f1" name="block-search"/>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontscolors PUBLIC "-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN"
"http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd">
<fontscolors>
<fontcolor name="whitespace"/>
<fontcolor default="string" name="markup-attribute-value"/>
<fontcolor bgColor="ff2b2b2b" foreColor="ffdddddd" name="default">
<font name="Monaco" size="12"/>
</fontcolor>
<fontcolor foreColor="ff00ccff" name="operator"/>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontscolors PUBLIC "-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN"
"http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd">
<fontscolors>
<fontcolor default="number" name="GSF_INT_LITERAL"/>
<fontcolor default="number" foreColor="ff66cc00" name="GSF_FLOAT_LITERAL"/>
<fontcolor name="mod-interface"/>
<fontcolor foreColor="ffd1ceff" name="GSF_INSTANCE">
<font style="bold"/>
</fontcolor>
cd /usr/local/src
curl -O http://umn.dl.sourceforge.net/sourceforge/ruby-ldap/ruby-ldap-0.9.7.tar.gz
tar xzvf ruby-ldap-0.9.7.tar.gz
cd ruby-ldap-0.9.7
ruby extconf.rb
make
make install
<%= stylesheet_tag 'my-site-wide-css' %>
<%= yield(:head_css) || (stylesheet_link_tag 'general_header_css') %>
# email
validates_format_of :email, :with => /(^([^@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i
# url
validates_format_of :url, :with => /^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(([0-9]{1,5})?\/.*)?$/ix
# password
validates_format_of :password, :with => /^\w+$/ (alphanumeric)
# First, specify the Host that we will be using later for user_notifier.rb
HOST = 'http://www.yourrailsapp.com'
# Second, add the :user_observer
Rails::Initializer.run do |config|
# The user observer goes inside the Rails::Initializer block
config.active_record.observers = :user_observer
end
# Third, add your SMTP settings
class UserNotifier < ActionMailer::Base
def signup_notification(user)
setup_email(user)
@subject += 'Please activate your new account'
@body[:url] = "#{HOST}/activate/#{user.activation_code}"
end
def activation(user)
setup_email(user)
Thank you!
<%= @user.login %>, your account has been activated.
You may now start using the member only features.
<%= @url %>