Using JSON in Postgres by example.
- Download and install: Docker Toolbox
- Open Docker Quickstart Terminal
- Start a new postgres container:
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
import {Stream} from 'most' | |
const fromNodeCallBack = fn => (...args) => new Stream(new CallBackSource(fn, args)) | |
class CallBackSource { | |
constructor (fn, args) { | |
this.fn = fn | |
this.args = args | |
} |
Using JSON in Postgres by example.
docker run --name my-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
/** | |
Proof-of-concept server-sent events HTTP server using Node.js and RxJS | |
Open http://localhost:8000 in a browser and view the console. | |
**/ | |
var http = require('http'), | |
https = require('https'); | |
var Rx = require('rx'); |
❯ rollup --version | |
rollup version 0.25.3 | |
❯ time rollup -c ./rollup.js | |
rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total | |
❯ time webpack | |
Hash: ebb00bbccd954c114d3c | |
Version: webpack 2.0.7-beta | |
Time: 3623ms |
'use static'; | |
const http = require('http'); | |
const most = require('most'); | |
const port = 3000; | |
const server = http.createServer(); | |
most.fromEvent('listening', server).forEach(() => { |
import React, { Component } from 'react'; | |
import { createStore, combineReducers, applyMiddleware, bindActionCreators } from 'redux'; | |
import { provide, connect } from 'react-redux'; | |
import thunk from 'redux-thunk'; | |
const AVAILABLE_SUBREDDITS = ['apple', 'pics']; | |
// ------------ | |
// reducers | |
// ------------ |
import Html exposing (Html, Attribute) | |
import Html.Attributes | |
import Html.Events | |
import Signal exposing (Address) | |
import List | |
import String | |
import StartApp | |
------------------ | |
--- HELPER CODE -- |
[Background] | |
Color=40,40,40 | |
[BackgroundIntense] | |
Color=40,40,40 | |
[Color0] | |
Color=73,72,62 | |
[Color0Intense] |
Tested under webpack-dev-server 1.7.0.
npm install
npm start
var webpack = require('webpack'); | |
var HtmlWebpackPlugin = require('html-webpack-plugin'); | |
var path = require('path'); | |
var folders = { | |
APP: path.resolve(__dirname, '../app'), | |
BUILD: path.resolve(__dirname, '../build'), | |
BOWER: path.resolve(__dirname, '../bower_components'), | |
NPM: path.resolve(__dirname, '../node_modules') | |
}; |