Skip to content

Instantly share code, notes, and snippets.

View Nickibrochner's full-sized avatar

Nicki Wassmann Brøchner Nickibrochner

View GitHub Profile
Verifying my Blockstack ID is secured with the address 179AJ3rxPcjpcCmVVeorEoYEouT51xZJxk https://explorer.blockstack.org/address/179AJ3rxPcjpcCmVVeorEoYEouT51xZJxk
Verifying my Blockstack ID is secured with the address 1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo https://explorer.blockstack.org/address/1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo
Verifying my Blockstack ID is secured with the address 1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo https://explorer.blockstack.org/address/1C4ux7BhQ81ieNkELZweGdR4TsMiCrsFQo
Verifying my Blockstack ID is secured with the address 1Dp8FiNMTg49XwKn4xdqT9RrKLCiFHze5U https://explorer.blockstack.org/address/1Dp8FiNMTg49XwKn4xdqT9RrKLCiFHze5U
// En test af Group
app.get('/testaar', function(req, res) {
function QueryMongoDB(callback) {
MongoClient.connect('mongodb://localhost:27017/Akkredibot', function(err, db) {
if (err) throw err
// her vælges akkredibot databasen inklusiv query
db.collection('akkrdata').aggregate([
{$group:
app.get('/chart', function(req, res) {
// Now we can run a script and invoke a callback when complete, e.g.
runScript('/home/nicki/akkredibot/js/drawchart.js', function (err) {
if (err) throw err;
jsonResponse.push(
{text: "Filnavn: "+imagename+""},
{ "attachment": {
"type": "image",
"payload": {
const ChartjsNode = require('chartjs-node');
// 600x600 canvas size
var chartNode = new ChartjsNode(600, 600);
var randomnumber=Math.random();
var imagename = "testimage"+randomnumber+".png"
module.exports = imagename
// each api returns a Promise
chartNode.drawChart({
type: 'bar',
@Nickibrochner
Nickibrochner / gist:4597cbb8418745b4c98bbc2f043f687c
Created July 14, 2017 08:43
Trying to call drawchar.js via GET
app.get('/test', function(req, res) {
var childProcess = require('child_process');
function runScript(scriptPath, callback) {
// keep track of whether callback has been invoked to prevent multiple invocations
var invoked = false;
var process = childProcess.fork(scriptPath);