pip3 install pipenv
pipenv shell
addEventListener('fetch', event => { | |
event.respondWith(purgeCache(event.request)) | |
}) | |
async function purgeCache(request) { | |
const url = new URL(request.url) |
exports.handler = (event, context, callback) => { | |
const response = { | |
statusCode: 301, | |
headers: { | |
Location: 'https://google.com', | |
} | |
}; | |
return callback(null, response); | |
} |
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) => { | |
/* |
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
Grails slack plugin appears to do most of the work here
Visit: https://slack.com/ and create a new slack channel Goto Configure apps/integration and create a webhook Configure webhook url in the plugin
If you are using pre grails 2.3, get hold of the grails 2 project from : https://github.com/mathifonseca/grails-slack/tree/grails-2.x
Copy the content of the plugin https://github.com/mathifonseca/grails-slack/tree/grails-2.x/src/groovy/grails/plugin/slack & https://github.com/mathifonseca/grails-slack/tree/master/grails-app/services/grails/plugin/slack to your local application For grails 2.0.1:
body { | |
color: #212121; | |
font-family: "Helvetica Neue", "Calibri Light", Roboto, sans-serif; | |
-webkit-font-smoothing: antialiased; | |
-moz-osx-font-smoothing: grayscale; | |
letter-spacing: 0.02em; | |
} |
user nginx; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
@Grab('javax.mail:mail:1.4.7') | |
import java.util.Properties | |
import javax.mail.* | |
import javax.mail.internet.* | |
final String FROM = "[email protected]" // Replace with your "From" address. This address or domain must be verified. | |
final String TO = "[email protected]" // Replace with a "To" address. If your account is still in the | |
// sandbox, this address must be verified. |
# | |
# Cutom Environment Variables for Tomcat | |
# | |
############################################ | |
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre | |
export PATH=${JAVA_HOME}/bin:${PATH} | |
############################################ | |
# | |
# JAVA_OPTS |