Skip to content

Instantly share code, notes, and snippets.

View context.xml
<Manager className="org.apache.catalina.session.PersistentManager">
<Store className="com.yourcompany.JedisStore" redisAddress="redis://localhost:6379" />
</Manager>
View JedisStore.java
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;
View iot-policy-example-1.json
{
"Statement":[
{
"Action":[
"iot:Receive",
"iot:Subscribe",
"iot:Connect"
],
"Effect":"Allow",
"Resource":[
@jonyt
jonyt / connect_heroku_to_amazon_rds
Last active Apr 13, 2017
How to connect a Heroku application to an Amazon RDS Postgresql instance
View connect_heroku_to_amazon_rds
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 Aug 29, 2015
A basic example of how to use the boxit widget.
View boxit_basic
<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 Aug 29, 2015
Boxit widget example usage - radio buttons
View boxit_example_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 Aug 29, 2015
Boxit widget example usage - dropdown and map
View boxit_example_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 Aug 29, 2015
Boxit widget example usage - dropdown only
View boxit_example_dropdown
<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>