This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://gist.github.com/ak-il/e91bfbd2c7c83086c7ded41512335795 | |
import gql from 'graphql-tag'; | |
import { | |
GET_LIST, | |
GET_ONE, | |
GET_MANY, | |
CREATE, | |
UPDATE, | |
DELETE, | |
} from 'react-admin'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q: En nu wil ik het naadje van de kous weten van Apollo in Express | |
A: https://www.robinwieruch.de/graphql-apollo-server-tutorial/ | |
Q: Genereer een veilig token dat in een URL gebruikt kan worden | |
A: https://stackoverflow.com/questions/8855687/secure-random-token-in-node-js | |
``` | |
const crypto = require('crypto') | |
const randomBytes = Util.promisify(crypto.randomBytes) | |
const plain = (await randomBytes(24)).toString('base64').replace(/\W/g, '') | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sql = require('mssql') | |
const config = {} | |
const pool = new sql.ConnectionPool(config) | |
.connect() | |
.then(connPool => { | |
console.log('Connected to MSSQL') | |
return connPool | |
}) | |
.catch(err => console.log('Database Connection Failed! Bad Config: ', err)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tape from 'tape' | |
import moment from 'moment' | |
const getLastIsoWeekOfYear = year => | |
moment() | |
.isoWeek(30) | |
.isoWeekYear(year + 1) | |
.isoWeek(1) | |
.isoWeekday(1) | |
.add(-1, 'days') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let re = /^(\d*[\wäöüß\d '\/\\\-\.]+)[,\s]+(\d+)\s*([\wäöüß\d\-\/]*)$/i | |
let adressen = [ | |
'Dorpstraat 2', | |
'Dorpstr. 2', | |
'Laan 1933 2', | |
'18 Septemberplein 12', | |
'Kerkstraat 42-f3', | |
'Kerk straat 2b', | |
'42nd street, 1337a', | |
'1e Constantijn Huigensstraat 9b', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |