Skip to content

Instantly share code, notes, and snippets.

View johanneslumpe's full-sized avatar

Johannes Lumpe johanneslumpe

View GitHub Profile
johanneslumpe / gulpfile.js
Created October 14, 2015 13:57 — forked from cgmartin/gulpfile.js
Node ES6 istanbul, isparta, mocha-co gulpfile example
View gulpfile.js
'use strict';
var gulp = require('gulp');
var del = require('del');
var mocha = require('gulp-mocha-co');
var istanbul = require('gulp-istanbul');
var isparta = require('isparta');
var coverageEnforcer = require('gulp-istanbul-enforcer');
var paths = {
server: {
johanneslumpe / 0_example.js
Last active November 3, 2015 18:23 — forked from tappleby/0_example.js
redux request middleware using superagent and es6 promises.
View 0_example.js
import { createStore, applyMiddleware, compose } from 'redux';
import request from 'superagent-es6-promise';
import thunkMiddlware from 'redux-thunk';
import promiseMiddleware from 'redux-promise';
import logMiddleware from './middleware/log';
import requestMiddleware from './middleware/request';
// Create request middleware with our execute logic, return promise.
const executeRequestMiddleware = requestMiddleware((req, getState) => {
const { session: { token } } = getState();
View json_manipulator.sql
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
SELECT * FROM json_each(data)
SELECT * FROM json_each(insert_data)
) t;