Skip to content

Instantly share code, notes, and snippets.

View jthoenes's full-sized avatar
👣

Johannes Thönes jthoenes

👣
View GitHub Profile
@jthoenes
jthoenes / imageStorage.js
Created March 13, 2014 09:18
API for image storage function of Redactor Feature Request
var storeImageLocally = function(imageFile, callback){
// result of asynchronous call which will store the file
var result = {
localUrl: 'filesystem:http://localhost:9000/persistent/someImage.jpg',
imageId: 'generated uid'
}
// call the callback with html to insert into redactor
callback('<img src="'+result.localUrl+'" data-image-id="'result.imageId'">');
}
@jthoenes
jthoenes / report.js
Last active August 29, 2015 14:21 — forked from renatoargh/report.js
// http://www.highcharts.com/docs/export-module/render-charts-serverside
'use strict';
var PdfPrinter = require('pdfmake'),
printer,
moment = require('moment-timezone'),
path = require('path'),
fs = require('fs');
function resolvePath(relative) {
@jthoenes
jthoenes / command.sh
Created August 20, 2018 11:59
Create list of AWS IP ranges (ec2, in Frankfurt) for OpenVPN config
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq -r '.prefixes[] | select(.service=="EC2") | select(.region=="eu-central-1") | .ip_prefix' | xargs -I {} ipcalc -nb {} | awk 'BEGIN {RS="";FS="\n"}{print $1, $2}' | awk '{print "route", $2, $4, "vpn_gateway"}'

Keybase proof

I hereby claim:

  • I am jthoenes on github.
  • I am jthoenes (https://keybase.io/jthoenes) on keybase.
  • I have a public key ASBIR_vSjbR9LDgTFLo0QjlYNRCeUTfOXANacPlKejf5ogo

To claim this, I am signing this object: