Skip to content

Instantly share code, notes, and snippets.

@teggr
teggr / index.html
Created May 18, 2016 13:48
javapoly.js example
<html>
<head>
<!-- Include the Polyfill -->
<script type="text/javascript" src="https://www.javapoly.com/javapoly.js"></script>
<!-- Invoke your Java code from Javascript -->
<script type="text/java">
package com.javapoly.demo;
import com.javapoly.dom.Window;
@teggr
teggr / HomeController.java
Last active January 12, 2016 23:46
Spring boot web starter snippets
@RequestMapping("/")
@Controller
public class HomeController {
@RequestMapping(method = RequestMethod.GET)
public String home(ModelMap map) {
return "home";
}
}
@teggr
teggr / apache-reverse-proxy.sh
Last active December 31, 2015 03:09
Useful linux commands
# http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
# http://httpd.apache.org/docs/current/mod/mod_proxy_html.html
# http://www.apachetutor.org/admin/reverseproxies
# http://httpd.apache.org/docs/2.2/mod/mod_substitute.html
# load mod_proxy_html
sudo yum install mod_proxy_html
sudo vi /etc/httpd/conf/httpd.conf
# Find modules
LoadModule proxy_html_module modules/mod_proxy_html.so
@teggr
teggr / webappd
Last active December 28, 2015 23:39
Executable Tomcat Webapp Jar file init.d script Credits: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/ Tomcat Maven Plugin: http://tomcat.apache.org/maven-plugin.html
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: webapp daemon
#
DAEMON_PATH="/opt/APP_NAME/bin"
DAEMON='java -jar ../APP_NAME.jar'
DAEMONOPTS=""
@teggr
teggr / serviced
Last active December 28, 2015 16:19
Executable Java Jar file init.d script Credits: http://werxltd.com/wp/2012/01/05/simple-init-d-script-template/
#!/bin/sh
#
# chkconfig: 2345 20 80
# description: java app daemon
#
DAEMON_PATH="/opt/APP_NAME/bin"
DAEMON='java -jar ../APP_NAME.jar'
DAEMONOPTS=""