Skip to content

Instantly share code, notes, and snippets.

@mprins
mprins / InChi.js
Created August 16, 2019 10:22 — forked from lsauer/InChi.js
Regular Expressions for validating SMILES, InChi, InChiKey
// International Chemical Identifier Regex, by lo sauer - lsauer.com
// Morphine InchI:
var x="InChI=1S/C17H19NO3/c1-18-7-6-17-10-3-5-13(20)16(17)21-15-12(19)4-2-9(14(15)17)8-11(10)18/h2-5,10-11,13,16,19-20H,6-8H2,1H3/t10-,11+,13-,16-,17-/m0/s1"
// applying an organic character-subset
// we could check for the length property, but in case of 0 matches 'null' is returned -> hence !!.. \ generally equal to Boolean(..)
!!x.trim().match(/^((InChI=)?[^J][0-9BCOHNSOPrIFla+\-\(\)\\\/,pqbtmsih]{6,})$/ig)
>true
//generic:
x.trim().match(/^((InChI=)?[^J][0-9a-z+\-\(\)\\\/,]+)$/ig)
@mprins
mprins / sshloginlogger.sh
Last active April 24, 2018 12:05
ssh ForceCommand logging
#!/bin/bash
#
# Script file voor sshd (ForceCommand)
#
# in sshd_config opnemen:
#
# ForceCommand <pad>/<naar>/sshloginlogger.sh
#
# Maak vervolgens de logfile aan:
# sudo touch /var/log/login_audit.log

postgresql

export POSTGRES_PASSWORD=postgres
export POSTGRES_PASSWORD=postgres
export PGPASSWORD=postgres
.build/ci/pgsql-start-docker.sh 16-3.4-alpine
.build/ci/pgsql-create-databases.sh
.build/ci/pgsql-setup.sh
@mprins
mprins / mapillary vector layer
Created September 11, 2014 15:54
loading Mapillary in an OpenLayers vector layer
// have a div like:
// <div id="map" style="width:400px;height:400px;"></div>
// then
var WGS84 = new OpenLayers.Projection('EPSG:4326');
var MERCATOR = new OpenLayers.Projection('EPSG:900913');
var map = new OpenLayers.Map("map");
map.addLayer(new OpenLayers.Layer.OSM());
var aoi = new OpenLayers.Bounds(4, 51.0, 6.0, 57.0).transform(WGS84, MERCATOR);
map.zoomToExtent(aoi);
@mprins
mprins / cbsviewer.md
Last active December 23, 2015 04:19
notities voor presentatie over CBS viewer bij CBS en PGGG

notities presentatie CBS viewer

facts & figures

  • Aanvang project omstreeks augustus 2012, eerste broncode op 29 augustus
  • Meeste werk uitgevoerd in Q4 van 2012
  • Gebouwd op open standaarden:
    • Open Gis Consortium (OGC)/International Standards Organisation (ISO) koppelvlakken:
      • Web Map Service (WMS)
  • Web Map Tile Service (WMTS)