Skip to content

Instantly share code, notes, and snippets.

version: '3'
services:
pg_eap:
restart: always
image: lovearuis/postgres10_plv8:latest
ports:
- 5432:5432
volumes:
- /Users/liurui/develop/docker/docker_volume/pgdata_eap:/var/lib/postgresql/data
CREATE OR REPLACE FUNCTION table_create()
RETURNS EVENT_TRIGGER
LANGUAGE plpgsql
AS $$
DECLARE oid INT;
table_name VARCHAR;
short_table_name VARCHAR;
parent_tables VARCHAR [];
is_tree BOOL;
is_basic BOOL;
FROM postgres:10
MAINTAINER aruis (lovearuis@gmail.com)
RUN apt-get -y update
RUN apt-get -y install postgresql-server-dev-10
RUN apt-get -y install postgresql-10-plv8
RUN rm -rf /var/lib/apt/lists/*
SET search_path = "public", "metadata", "extensions", "study";
SELECT
*,
rank()
OVER (
ORDER BY score.score ),
dense_rank()
OVER (
ORDER BY score.score ),
SELECT now();
CREATE TABLE product_info (
id SERIAL,
data JSONB
);
INSERT INTO product_info (data) VALUES
('{
"product_name": "chair",
CREATE TABLE employee
(
emp_id INT4,
employee_name VARCHAR(25),
department_id INT4,
salary NUMERIC(7, 2)
);
CREATE TABLE emp_salary_history (
emp_id INT,
@aruis
aruis / home_env.lua
Created December 2, 2017 00:27 — forked from chaosong/home_env.lua
nodemcu read dht22 and pms5003
function initWIFI()
print("Setting up WIFI...")
wifi.setmode(wifi.STATION)
wifi.sta.config("<wifi-id>", "<wifi-password>")
wifi.sta.connect()
tmr.alarm(1, 1000, 1,
function()
if wifi.sta.getip()== nil then
print("IP unavailable, Waiting...")
@aruis
aruis / EventBusService.ts
Created August 25, 2017 09:50 — forked from benorama/EventBusService.ts
Typescript version of Vertx EventBus Client for Angular
/**
* Based on Vertx EventBus Client (https://github.com/vert-x3/vertx-bus-bower)
* Requires SockJS Client
*/
import {EventEmitter, Injectable} from "@angular/core";
import * as SockJS from 'sockjs-client';
@Injectable()
export class EventBusService {
@aruis
aruis / my-vertx-application
Created July 5, 2017 15:07 — forked from cescoffier/my-vertx-application
Vert.x init.d service script
#!/bin/bash
###
# chkconfig: 345 20 80
# description: Vert.x application service script
# processname: java
#
# Installation (CentOS):
# copy file to /etc/init.d
# chmod +x /etc/init.d/my-vertx-application
package com.aruistest.jos
import io.vertx.groovy.core.Vertx
/**
* Created by aruis on 16-5-13.
*/
def vertx = Vertx.vertx()