Skip to content

Instantly share code, notes, and snippets.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Gist - GitHub</title>
<link href="http://assets1.github.com/stylesheets/bundle_common.css?7b750b3dc62c936bcb938491b275eae4bfb900e4" media="screen" rel="stylesheet" type="text/css" />
<link href="http://assets3.github.com/stylesheets/bundle_gist.css?7b750b3dc62c936bcb938491b275eae4bfb900e4" media="screen" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Gist - GitHub</title>
<link href="http://assets1.github.com/stylesheets/bundle_common.css?7b750b3dc62c936bcb938491b275eae4bfb900e4" media="screen" rel="stylesheet" type="text/css" />
<link href="http://assets3.github.com/stylesheets/bundle_gist.css?7b750b3dc62c936bcb938491b275eae4bfb900e4" media="screen" rel="stylesheet" type="text/css" />
aptitude update
aptitude upgrade
aptitude dist-upgrade
shutdown -r now
aptitude install build-essential -y
aptitude install mysql-server mysql-client libmysqlclient15-dev libmysql-ruby -y
mysqladmin -u root password yourpassword
def flash_helper
f_names = [:notice, :warning, :message]
fl = ''
for name in f_names
if flash[name]
fl = fl + "<div class=\"notice\">#{flash[name]}</div>"
end
flash[name] = nil;
<%= flash_helper %>
div.notice {
margin-left: auto;
margin-right: auto;
text-align: center;
width: 40%;
border: 5px solid #ccc;
margin-top: 50px;
padding: 20px;
font-weight: bold;
}
def send_email(from, from_alias, to, to_alias, subject, message)
msg = &lt;&lt;END_OF_MESSAGE
From: #{from_alias} &lt;#{from}>
To: #{to_alias} &lt;#{to}>
Subject: #{subject}
#{message}
END_OF_MESSAGE
/* Buttons
----------------------------------------------- */
p.button img {
position: absolute;
margin: 4px 0 0 5px;
}
p.button {
display: block;
<p class="button">
<img src="/img/buttons/add.png" />
<a href="#"><span>Add task</span></a>
</p>
package filters;
import java.io.IOException;
import javax.servlet.*;
public class UTF8Filter implements Filter
{
public void destroy() {}
public void doFilter(ServletRequest request,