rails preserve line breaks
simple_format(string)
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Nick Hammond nickhammond.com
simple_format(string)
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; background: transparent; } :focus { outline: 0; } body { } ol, ul {list-style: none;} caption, th, td { text-align: left; font-weight: normal; } blockquote:before, blockquote:after, q:before, q:after {content: "";} blockquote, q {quotes: "" "";} strong{font-weight: bold;} em{font-style: italic;} .clear{clear: both;} #content:after{ content: "."; height: 0; display: block; clear: both; visibility: hidden; } .left, #left{ float: left; display: inline; } .right, #right{ float: right; display: inline; }
#something:after{ content: "."; height: 0; display: block; clear: both; visibility: hidden; }
config.active_record.timestamped_migrations = false
$(function(){ $('a[@rel$='external']').click(function(){ this.target = "_blank"; }); });
Event.observe(window, 'load', function() { $$('a[rel="external"]').each(function(link){ if(link.readAttribute('href') != '' && link.readAttribute('href') != '#'){ link.writeAttribute('target','_blank'); } }); });
<a rel="external" href="http://google.com">Google Rocks.</a>
<div id="slide-show"> <ul id="slide-images"> <li><img src="images/one.jpg" alt="One" title="One" /></li> <li><img src="images/two.jpg" alt="Two" title="Two" /></li> <li><img src="images/three.jpg" alt="Three" title="Three" /></li> </ul> </div>
#slide-images{ position:relative; display:block; margin:0px; padding:0px; width:290px; /* Adjust to width-height of your images */ height:142px; overflow:hidden; } #slide-images li{ position:absolute; display:block; list-style-type:none; margin:0px; padding:0px; background-color:#FFFFFF; } #slide-images li img{ display:block; background-color:#FFFFFF; }
var delay = 1000; var start_frame = 0; function init() { var lis = $('slide-images').getElementsByTagName('li'); for( i=0; i < lis.length; i++){ if(i!=0){ lis[i].style.display = 'none'; } } end_frame = lis.length -1; start_slideshow(start_frame, end_frame, delay, lis); } function start_slideshow(start_frame, end_frame, delay, lis) { setTimeout(fadeInOut(start_frame,start_frame,end_frame, delay, lis), delay); } function fadeInOut(frame, start_frame, end_frame, delay, lis) { return (function() { lis = $('slide-images').getElementsByTagName('li'); Effect.Fade(lis[frame]); if (frame == end_frame) { frame = start_frame; } else { frame++; } lisAppear = lis[frame]; setTimeout("Effect.Appear(lisAppear);", 0); setTimeout(fadeInOut(frame, start_frame, end_frame, delay), delay + 1850); }) } Event.observe(window, 'load', init, false);
config.reload_plugins = true
wget -r ftp://user:pass@domain.com
AuthType Basic AuthName "Protected" AuthUserFile /var/www/blah/.htpasswd Require valid-user
htpasswd -bc .htpasswd user pass