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 models; | |
import java.awt.image.BufferedImage; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import javax.imageio.ImageIO; | |
import play.libs.MimeTypes; | |
import play.modules.morphia.Blob; |
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
<script> | |
// <snip> | |
(function (window, document) { | |
var loader = function () { | |
var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0]; | |
script.src = "http://errorception.com/projects/" + _errs[0] + "/beacon.js"; | |
tag.parentNode.insertBefore(script, tag); | |
}; | |
// Wait until window.onload before downloading any more code. |
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
.fc { | |
direction: ltr; | |
text-align: left; } | |
.fc table { | |
border-collapse: collapse; | |
border-spacing: 0; } | |
.fc .btn { | |
line-height: 1.2em; } | |
html .fc { |
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
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.security.spec.InvalidKeySpecException; | |
import java.security.spec.KeySpec; | |
import java.util.Arrays; | |
import javax.crypto.SecretKeyFactory; | |
import javax.crypto.spec.PBEKeySpec; | |
public class PasswordEncryptionService { |
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 My_App() { | |
this.foo = '', | |
this.bar = '', | |
this.jQuery = false, | |
// Initializes our app. | |
this.init = function(params){ | |
// Set any custom app options. | |
for ( key in params ) this[key] = params[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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE: | |
// Uses a combination of object detection and user-agent | |
// sniffing. | |
// ---------------------------------------------------------- | |
// If you're not in IE then: | |
// ie === NaN // falsy | |
// If you're in IE then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: |
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 fi.markoa.proto.jersey2.jetty; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
public class JettyWebApp { | |
public static void main(String ... args) throws Exception { | |
Server server = new Server(8090); | |
WebAppContext webapp = new WebAppContext(); | |
webapp.setContextPath("/app1"); |
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
@Component | |
@org.springframework.context.annotation.Scope("prototype") | |
public class EmailServiceActor extends UntypedActor { | |
@Override | |
public void onReceive(Object message) throws Exception { | |
//Do actor stuff... | |
} | |
} |
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
/* | |
* jQuery.gdocViewer - Embed linked documents using Google Docs Viewer | |
* Licensed under MIT license. | |
* Date: 2011/01/16 | |
* | |
* @author Jawish Hameed | |
* @version 1.0 | |
*/ | |
(function($){ | |
$.fn.gdocsViewer = function(options) { |
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
@RequestMapping(value = "/hola", method = RequestMethod.GET) | |
public String hola(Model model, | |
@ModelAttribute("command") Object command, | |
BindingResult results, | |
RedirectAttributes redirectAttributes ) { | |
model.addAttribute("command", command); | |
ValidationUtils.invokeValidator(validator, command, results); | |
if (results.hasErrors()) { | |
redirectAttributes.addFlashAttribute("errors", results.getAllErrors()); |
OlderNewer