Skip to content

Instantly share code, notes, and snippets.

View RaymondKroon's full-sized avatar
😃

Raymond RaymondKroon

😃
View GitHub Profile
@RaymondKroon
RaymondKroon / gist:60f74ae45b2b67b79c45
Created November 6, 2014 17:03
Openlayers 3 WMTS voorbeeld
<!DOCTYPE html>
<html>
<head>
<title>PDOK Download App</title>
<link rel="stylesheet" href="http://openlayers.org/en/v3.0.0/css/ol.css" type="text/css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.3/proj4.js" type="text/javascript"></script>
<script src="http://openlayers.org/en/v3.0.0/build/ol.js" type="text/javascript"></script>
</head>
<body>
@RaymondKroon
RaymondKroon / Vertx-Repl-Cider
Last active August 29, 2015 14:14
Vertx repl cider support
It's not that hard, but I tend to easily forget
@RaymondKroon
RaymondKroon / core.clj
Created February 15, 2015 18:44
Spiral
(defn spiral [n]
(let [amounts (drop 1 (mapcat #(repeat 2 %) (range n 0 -1)))
directions (cycle [1 n -1 (- n)])
steps (mapcat (fn [a d] (repeat a d)) amounts directions)
values (reductions + steps)]
values))
@RaymondKroon
RaymondKroon / test.java
Last active August 29, 2015 14:20
getter/setter test
package nl.pdok.datamanagement.model;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.HashSet;
import java.util.Set;
rasterLayers:
for (RasterLayer layer : service.getRasterLayers()) {
String datastoreName = layer.getDatastoreName();
boolean doIt = false;
for(RasterDatastore rasterDatastore : service.getRasterDatastores()) {
if(datastoreName.equals(rasterDatastore.getName())) {
doIt= true;
}
}
if(!doIt) {
@RaymondKroon
RaymondKroon / ngrok-selfhosting-setup.md
Last active August 29, 2015 14:26 — forked from lyoshenka/ngrok-selfhosting-setup.md
How to setup Ngrok with a self-signed SSL cert

Intro

The plan is to create a pair of executables (ngrok and ngrokd) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other ngrok to connect to this ngrokd, and vice versa.

DNS

Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is domain.com, you'll need a record for that and for *.domain.com.

Different Operating Systems

### Keybase proof
I hereby claim:
* I am raymondkroon on github.
* I am raymondkroon (https://keybase.io/raymondkroon) on keybase.
* I have a public key ASAD-Eucvv8ZLd-9VhlEnXTpw0wDuDENifaGcK6dLw5RpQo
To claim this, I am signing this object:
@RaymondKroon
RaymondKroon / gpg2qrcodes.sh
Created April 11, 2016 15:50 — forked from joostrijneveld/gpg2qrcodes.sh
Producing printable QR codes for persistent storage of GPG private keys
# Heavily depends on:
# libqrencode (fukuchi.org/works/qrencode/)
# paperkey (jabberwocky.com/software/paperkey/)
# zbar (zbar.sourceforge.net)
# Producing the QR codes:
# Split over 4 codes to ensure the data per image is not too large.
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp
split temp -n 4 IMG
for f in IMG*; do cat $f | qrencode -o $f.png; done
for p in $(find . -name "*.shp"); do
f=${p##*/}
layer=${f%.*}
echo "file:$f -> $(ogrinfo $p $layer -so | grep PROJCS)"
done
@RaymondKroon
RaymondKroon / delete_all_object_versions.sh
Created May 15, 2017 20:54 — forked from weavenet/delete_all_object_versions.sh
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`