Skip to content

Instantly share code, notes, and snippets.

@porsager
porsager / session.js
Created February 2, 2018 14:05
custom postgress express-session store
const store = Object.assign(new session.Store(), {
get: (id, cb) =>
pg.oneOrNone(`
select
cookie, user_id as user
from sessions
where session_id = $[id]
`, { id }).then(s => cb(null, s)).catch(cb)
,
set: (id, session, cb) =>
@porsager
porsager / flems.json
Last active January 8, 2018 23:25
Changed description
{
"color": "#000",
"files": [{
"name": "test.js",
"compiler": "babel"
}]
}
import m from 'mithril'
m.render(document.body, m('h1', 'hello world'))
function test() {
const test = 'hej'
return test
}
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.b = factory());
}(this, (function () { 'use strict';
var popular = {
ai : 'alignItems',
b : 'bottom',
bc : 'backgroundColor',
define(["exports"], function (e) {
var module = {}
;(function() {
"use strict"
function Vnode(tag, key, attrs0, children, text, dom) {
return {tag: tag, key: key, attrs: attrs0, children: children, text: text, dom: dom, domSize: undefined, state: undefined, _state: undefined, events: undefined, instance: undefined, skip: false}
}
Vnode.normalize = function(node) {
if (Array.isArray(node)) return Vnode("[", undefined, undefined, Vnode.normalizeChildren(node), undefined, undefined)
body { background: #556677 }
const fs = require('fs')
, rollup = require('rollup')
, json = require('rollup-plugin-json')
, commonjs = require('rollup-plugin-commonjs')
, nodeResolve = require('rollup-plugin-node-resolve')
, wright = require('wright')
wright({
main: 'static/index.html',
run: 'm.redraw',
4 failing
1) SCOPED PM2 ACTIONS Test non auth remote commands should restart command via scoped pm2 action (no pass needed):
Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
2) SCOPED PM2 ACTIONS Password verification should error when call an action that is password protected:
Uncaught AssertionError: false == true
+ expected - actual