This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET search_path = "public", "metadata", "extensions", "study"; | |
SELECT | |
*, | |
rank() | |
OVER ( | |
ORDER BY score.score ), | |
dense_rank() | |
OVER ( | |
ORDER BY score.score ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT now(); | |
CREATE TABLE product_info ( | |
id SERIAL, | |
data JSONB | |
); | |
INSERT INTO product_info (data) VALUES | |
('{ | |
"product_name": "chair", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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...") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aruistest.jos | |
import io.vertx.groovy.core.Vertx | |
/** | |
* Created by aruis on 16-5-13. | |
*/ | |
def vertx = Vertx.vertx() |