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
// mavenCentral() | |
… | |
// mavenRepo "http://download.java.net/maven/2/" |
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
dependencies { | |
runtime 'javax.activation:activation:1.1.1' | |
runtime 'javax.mail:mail:1.4.3' | |
} |
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
mailSender(org.springframework.mail.javamail.JavaMailSenderImpl) { | |
host = 'smtp.gmail.com' | |
port = 465 | |
username = '<your email>@gmail.com' | |
password = '<your password>' | |
javaMailProperties = ['mail.smtp.auth': 'true', | |
'mail.smtp.socketFactory.port': '465', | |
'mail.smtp.socketFactory.class': 'javax.net.ssl.SSLSocketFactory', | |
'mail.smtp.socketFactory.fallback': 'false'] | |
} |
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
mailSender(org.springframework.mail.javamail.JavaMailSenderImpl) { | |
host = "smtp.your-domain.com" // your smtp server's address | |
port = 26 // or your smtp server's port | |
username = "username@your-domain.com" // if your smtp server requires authentication | |
password = "your password" // if your smtp server requires authentication | |
} |
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
package org.behrang.euler.q1; | |
public class Main { | |
public static void main(String[] args) { | |
long answer = 0; | |
for (int i = 0; i < 1000; i++) { | |
if (i % 3 == 0 || i % 5 == 0) { | |
answer += i; | |
} |
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
class Post << ActiveRecord::Base | |
trimify :title, :body | |
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
class Post << ActiveRecord::Base | |
trimify :title, :body, :nilify => false | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Gorgeous Login Form Demo</title> | |
<link href='http://fonts.googleapis.com/css?family=Ubuntu&v1' rel='stylesheet' type='text/css' /> | |
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset-fonts-grids/reset-fonts-grids.css" /> | |
<link rel="stylesheet" type="text/css" href="login-form.css" /> | |
<link rel="stylesheet" type="text/css" href="http://ajax.microsoft.com/ajax/jquery.ui/1.8.13/themes/redmond/jquery-ui.css" /> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.js"></script> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.js"></script> |
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
body { | |
font-size: 14px; | |
} | |
ul#login-details { | |
padding: 10px; | |
padding-top: 50px; | |
width: 500px; | |
margin: 0 auto; | |
} |
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
(function() { | |
/** | |
* Adds an animation effect to the given input element's label so that when some text | |
* is entered in the field, the label moves up and when the field is empty, the label | |
* goes back to its initial place. This function only works with the accompanying CSS | |
* styles. | |
*/ | |
function installAnimation(inputElem, marginTopEnd, animationLength) { | |
$(inputElem).bind('input', function() { | |
var label = $(this).prev("label"); |