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
public class SpelFreemarkerTemplateDirective implements TemplateDirectiveModel { | |
SpelEvaluator spelEvaluator; | |
@Required | |
public void setSpelEvaluator(SpelEvaluator spelEvaluator) { | |
this.spelEvaluator = spelEvaluator; | |
} | |
@Override | |
public void execute(Environment env, @SuppressWarnings("rawtypes") Map params, TemplateModel[] loopVars, |
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
<html> | |
<head> | |
<style type="text/css"> | |
table table { | |
width: 600px !important; | |
} | |
table div + div { /* main content */ | |
width: 65%; | |
float: left; | |
} |
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
public class CurrentUserLoggingFilter implements Filter { | |
public static final String MDC_CURRENT_ACCOUNT_ID_KEY = "CurrentAccountId"; | |
@Context | |
HttpContext context; | |
@Override | |
public void init(FilterConfig filterConfig) throws ServletException { /* unused */ } |
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
public class CurrentUserLoggingFilter implements Filter { | |
public static final String MDC_CURRENT_ACCOUNT_ID_KEY = "CurrentAccountId"; | |
@Context | |
HttpContext context; | |
@Override | |
public void init(FilterConfig filterConfig) throws ServletException { /* unused */ } |
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
# Just an example. | |
# @video is a direct reference to a '<video>' element. | |
# $() is assuming jQuery is being used in this example. | |
@video.addEventListener("loadedmetadata", (event) => | |
actualRatio = @video.videoWidth/@video.videoHeight | |
targetRatio = $(@video).width()/$(@video).height() | |
adjustmentRatio = targetRatio/actualRatio | |
$(@video).css("-webkit-transform","scaleX(#{adjustmentRatio})") | |
) |
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
#!/bin/sh | |
# set the configuration variables below, before running the script | |
# get the solr nightly build download link from https://builds.apache.org/job/Solr-Artifacts-4.x/lastSuccessfulBuild/artifact/solr/package/ | |
JETTY_URL="http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.5.v20130815.tar.gz&r=1" | |
JETTY_HOME="/opt/jetty" | |
JAVA='/usr/local/jdk1.7.0_09/bin/java' | |
JETTY_PORT=8085 | |
JETTY_HOST=127.0.0.1 |
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
'use strict'; | |
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' |
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
description "service" | |
start on filesystem | |
stop on runlevel S | |
respawn | |
respawn limit 10 5 | |
oom never | |
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop. |
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
@WebServlet("/upload") | |
@MultipartConfig(location = "/tmp") | |
public class FileUploadServlet extends HttpServlet { | |
@Override | |
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { | |
getServletContext().getRequestDispatcher("/WEB-INF/views/fileUpload.jsp").forward(req, res); | |
} | |
@Override |
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
# Artie - Artie Server | |
# | |
# Real-time messaging service | |
description "artie" | |
start on filesystem | |
stop on runlevel S | |
respawn |