Skip to content

Instantly share code, notes, and snippets.

@javajack
javajack / gist:3143114
Created July 19, 2012 11:13 — forked from kritzikratzi/gist:1275419
Another way to use play-morphia blobs
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;
<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.
.fc {
direction: ltr;
text-align: left; }
.fc table {
border-collapse: collapse;
border-spacing: 0; }
.fc .btn {
line-height: 1.2em; }
html .fc {
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];
// ----------------------------------------------------------
// 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:
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");
@javajack
javajack / redirect-after-post-flash-scope.java
Created December 23, 2013 18:32 — forked from oscarryz/gist:6381954
Spring Redirect After Post With Flash Scope
@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());
# How Akka maps to EAI Patterns
Might be up for debate or just plain wrong. Just some notes I scribbled down some time ago.
-----------------------------------------------------------------------------------------------------------------
EAI PATTERN AKKA PATTERN REFERENCE
-----------------------------------------------------------------------------------------------------------------
Point to Point Channel Regular Actor Communication http://www.eaipatterns.com/PointToPointChannel.html
Event-Driven Consumer Regular Actor Receive http://www.eaipatterns.com/EventDrivenConsumer.html
Message Selector Actor with Stash http://www.eaipatterns.com/MessageSelector.html
package org.backstage;
import au.com.bytecode.opencsv.CSVReader;
import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Table;
import com.vaadin.ui.Upload;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
<link href="print.css" rel="stylesheet" type="text/css" media="screen,print"/>
...
<div style="-fs-page-sequence: start; page-break-before: always">
<div style="position: running(current);">
<div id="page-header" class="small">
<span class="align-left">some stuff here</span>
<span class="align-right">some other stuff here</span>
<div class="line">&#160;</div>