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
You'll get this w/ rackspace cloud when an IP in your cloud gets re-used(if you deleted a server, and then later create a server that gets assigned the old one's IP). You can disable this error by adding the following to .ssh/config, however be aware of the security considerations here...namely, if Rackspace DNS is compromised, you won't have any warning if the hostname gets pointed to a different computer. | |
Host *static.cloud-ips.com | |
StrictHostKeyChecking no | |
UserKnownHostsFile=/dev/null |
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
flash.each_pair do |key, value| | |
puts key #notice, warning, etc | |
puts value #message of the flash | |
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
module ReservedWords | |
RESERVED = YAML.load_file(File.join(Rails.root, "config", "reserved_words.yml")) | |
def self.usernames | |
@usernames ||= begin | |
reserved = [] | |
Rails.application.routes.routes.each do |r| | |
reserved += r.path.gsub(/(\(.*\)|:)/, '').split('/') | |
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
tags = text.match(/#([a-z]|[A-Z]|[0-9]|\-|\_)+/g); | |
text = text.replace(new RegExp("#{tag}(?![A-Za-z0-9\-\_])", "g"), "<a class = 'tag' href = '#{@tagUrl(tag.substring(1))}'>#{tag}</a>") for tag in tags if tags |
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
regex = /(^|\s)((https?:\/\/)?((\.?[\w-])+)(\.(COM|NET|ORG|GOV|ASIA|IN|INFO|UK|US|JOBS|FR|LY|BIZ|AC|AD|AE|AERO|AF|AG|AI|AL|AM|AN|AO|AQ|AR|ARPA|AS|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BM|BN|BO|BR|BS|BT|BV|BW|BY|BZ|CA|CAT|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|COOP|CR|CU|CV|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EDU|EE|EG|ER|ES|ET|EU|FI|FJ|FK|FM|FO|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|INT|IO|IQ|IR|IS|IT|JE|JM|JO|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|MA|MC|MD|ME|MG|MH|MIL|MK|ML|MM|MN|MO|MOBI|MP|MQ|MR|MS|MT|MU|MUSEUM|MV|MW|MX|MY|MZ|NA|NAME|NC|NE|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PRO|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|ST|SU|SV|SY|SZ|TC|TD|TEL|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TP|TR|TRAVEL|TT|TV|TW|TZ|UA|UG|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|YE|YT|ZA|ZM|ZW))(((:\d+)|#|\/|\?)(\S*)|\b))/gi; |
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
www: | |
requirements: | |
- faye | |
- jade |
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
##formtastic_datepicker_interface | |
module Formtastic | |
module DatePicker | |
protected | |
def datepicker_input(method, options = {}) | |
format = options[:format] || ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS[:default] || '%d %b %Y' | |
string_input(method, datepicker_options(format, object.send(method)).merge(options)) | |
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
##put this in your helper | |
# Passes the authenticity token for use in javascript | |
def yield_authenticity_token | |
if protect_against_forgery? | |
<<JAVASCRIPT | |
<script type='text/javascript'> | |
//<![CDATA[ | |
window._auth_token_name = "#{request_forgery_protection_token}"; | |
window._auth_token = "#{form_authenticity_token}"; |
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
$(document).ready(function() { | |
$("a").click(function() {h |