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[rel=external]").click(function(){ | |
_gaq.push(['_trackPageview', '/outgoing/' + $(this).attr('href')]); | |
}); | |
}); |
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
<a rel='external' href='http://blog.reservationlive.net/'>ReservationLove</a> |
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
180.upto(230) do |green| | |
if green % 10 == 0 | |
puts "<p style='background:#fa" + green.to_s(base=16) + "ae;'>Sexy</p>" | |
end | |
end | |
230.downto(180) do |red| | |
if red % 10 == 0 | |
puts "<p style='background:#" + red.to_s(base=16) + "faae;'>Sexy</p>" | |
end | |
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
/* ------------------------------------------------------------------------- */ | |
// Convert str to UTF-8 (if not already), then convert that to HTML named entities. | |
// and numbered references. Compare to native htmlentities() function. | |
// Unlike that function, this will skip any already existing entities in the string. | |
// mb_convert_encoding() doesn't encode ampersands, so use makeAmpersandEntities to convert those. | |
// mb_convert_encoding() won't usually convert to illegal numbered entities (128-159) unless | |
// there's a charset discrepancy, but just in case, correct them with correctIllegalEntities. | |
function makeSafeEntities($str, $convertTags = 0, $encoding = "") { | |
if (is_array($arrOutput = $str)) { | |
foreach (array_keys($arrOutput) as $key) |
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
For example, convert this: | |
["AUD", "Australian Dollar"], | |
["NZD", "New Zealand Dollar"], | |
["USD", "US Dollar"], | |
to this: | |
["Australian Dollar", "AUD"], | |
["New Zealand Dollar", "NZD"], |
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
<% for comment in @article.comments %> | |
<p>Name: <%=h comment.name %><br /> | |
Comment: <%=h comment.body %></p> | |
<hr /> | |
<% 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
#!/usr/bin/env ruby | |
# | |
# Originally written by http://redartisan.com/tags/csv | |
# Added and minor changes by Gavin Laking | |
# Remove ::Reader and it shall work in Ruby 1.9.x | |
# | |
# "id","name","mime_type","extensions","icon_url" | |
# "1","unknown","unknown/unknown","||","/images/icon/file_unknown.gif" | |
# "2","image/tiff","image/tiff","|tiff|tif|","/images/icon/blank.png" | |
# |
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
## | |
# Calendar helper with proper events | |
# http://www.cuppadev.co.uk/webdev/making-a-real-calendar-in-rails/ | |
# | |
# (C) 2009 James S Urquhart (jamesu at gmail dot com) | |
# Derived from calendar_helper | |
# (C) Jeremy Voorhis, Geoffrey Grosenbach, Jarkko Laine, Tom Armitage, Bryan Larsen | |
# Licensed under MIT. http://www.opensource.org/licenses/mit-license.php | |
## | |