SameSite=strict cookies is another layer to help prevent CSRF attacts in newer browsers
(at least 5, no clue about earlier versions)
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@| db.Transactions.aggregate([ | |
| { | |
| "$group": { | |
| "_id": null, | |
| "count": { | |
| "$sum": 1 | |
| }, | |
| "values": { | |
| "$push": "$INSERT_VALUE_TO_GET_MEDIAN_OF_HERE" | |
| } |
| const fs = require('fs'); | |
| const jwt = require('jsonwebtoken'); | |
| // http://travistidwell.com/blog/2013/09/06/an-online-rsa-public-and-private-key-generator/ | |
| // use 'utf8' to get string instead of byte array (1024 bit key) | |
| var privateKEY = fs.readFileSync('./private.key', 'utf8'); // to sign JWT | |
| var publicKEY = fs.readFileSync('./public.key', 'utf8'); // to verify JWT | |
| module.exports = { | |
| sign: (payload, $Options) => { | |
| /* |
SameSite=strict cookies is another layer to help prevent CSRF attacts in newer browsers
(at least 5, no clue about earlier versions)
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,3 +1,3 @@| // GeoChart from https://google-developers.appspot.com/chart/interactive/docs/gallery/geochart | |
| // Try out by pasting code into: https://code.google.com/apis/ajax/playground/?type=visualization#geo_chart | |
| function drawVisualization() { | |
| var data = google.visualization.arrayToDataTable([ | |
| ['State', 'Foo Factor'], | |
| ['US-IL', 200], | |
| ['US-IN', 300], | |
| ['US-IA', 20], |
| # Major US Cities with DMA Codes | |
| major_cities = [ | |
| {'city': 'Ada', 'dma_code': 657, 'latitude': 34.774531000000003, 'longitude': -96.678344899999999, 'region': 'OK', 'slug': 'ada-ok'}, | |
| {'city': 'Akron', 'dma_code': 510, 'latitude': 41.081444699999999, 'longitude': -81.519005300000003, 'region': 'OH', 'slug': 'akron-oh'}, | |
| {'city': 'Albany', 'dma_code': 525, 'latitude': 31.578507399999999, 'longitude': -84.155741000000006, 'region': 'GA', 'slug': 'albany-ga'}, | |
| {'city': 'Alexandria', 'dma_code': 644, 'latitude': 31.311293599999999, 'longitude': -92.445137099999997, 'region': 'LA', 'slug': 'alexandria-la'}, | |
| {'city': 'Alpena', 'dma_code': 583, 'latitude': 45.061679400000003, 'longitude': -83.432752800000003, 'region': 'MI', 'slug': 'alpena-mi'}, | |
| {'city': 'Altoona', 'dma_code': 574, 'latitude': 40.5186809, 'longitude': -78.394735900000001, 'region': 'PA', 'slug': 'altoona-pa'}, | |
| {'city': 'Amarillo', 'dma_code': 634, 'latitude': 35.221997100000003, 'longitude': -101.8312969, 'region': 'TX', 'slug': 'amarillo-tx'}, |