Skip to content

Instantly share code, notes, and snippets.

<Manager className="org.apache.catalina.session.PersistentManager">
<Store className="com.yourcompany.JedisStore" redisAddress="redis://localhost:6379" />
</Manager>
import com.codahale.metrics.Histogram;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.Timer;
import com.codahale.metrics.jmx.JmxReporter;
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Session;
import org.apache.catalina.session.StandardSession;
import org.apache.catalina.session.StoreBase;
{
"Statement":[
{
"Action":[
"iot:Receive",
"iot:Subscribe",
"iot:Connect"
],
"Effect":"Allow",
"Resource":[
@jonyt
jonyt / connect_heroku_to_amazon_rds
Last active April 13, 2017 00:11
How to connect a Heroku application to an Amazon RDS Postgresql instance
Download the certificate with:
`wget -O config/rds-combined-ca-bundle.pem http://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem`
Then connect with:
`postgres://user:password@amazon-host/db_name?sslmode=require&sslrootcert=config/rds-combined-ca-bundle.pem`
References:
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_PostgreSQL.html#PostgreSQL.Concepts.General.SSL
https://github.com/jeremyevans/sequel/issues/897
http://www.postgresql.org/docs/9.3/static/libpq-connect.html#LIBPQ-CONNECT-SSLROOTCERT
http://dba.stackexchange.com/questions/77811/how-to-connect-to-an-amazon-postgresql-database-using-ssl
@jonyt
jonyt / boxit_basic
Last active August 29, 2015 14:05
A basic example of how to use the boxit widget.
<script type="text/javascript" src="http://www.boxit.co.il/exmp/js/dropdown.js"></script>
<script type="text/javascript">Boxit.create();</script>
<a href="#" onclick="openMap(); return false;">מפה</a>
@jonyt
jonyt / boxit_example_radio_buttons
Last active August 29, 2015 14:04
Boxit widget example usage - radio buttons
<html>
<head>
<title>דוגמא</title>
</head>
<body>
<form>
<label>
<input type="radio" name="optionsRadios" id="radio-mail" value="mail" onclick="handleClick(this);" checked="checked">
דואר
</label>
@jonyt
jonyt / boxit_example_dropdown_and_map
Last active August 29, 2015 14:04
Boxit widget example usage - dropdown and map
<html>
<head>
<title>דוגמא</title>
</head>
<body>
<form>
<script type="text/javascript" src="http://www.boxit.co.il/exmp/js/dropdown.js"></script>
<script type="text/javascript">Boxit.create();</script>
<a href="#" onclick="openMap(); return false;">מפה</a>
<input type="submit" value="הזמן">
@jonyt
jonyt / boxit_example_dropdown
Last active August 29, 2015 14:04
Boxit widget example usage - dropdown only
<html>
<head>
<title>דוגמא</title>
</head>
<body>
<form>
<script type="text/javascript" src="http://www.boxit.co.il/exmp/js/dropdown.js"></script>
<script type="text/javascript">Boxit.create();</script>
<input type="submit" value="הזמן">
</form>