Skip to content

Instantly share code, notes, and snippets.

View vnnvanhuong's full-sized avatar

Huong Nguyen vnnvanhuong

View GitHub Profile
'use strict';
const express = require('express');
const PORT = process.env.PORT || 8080;
const app = express();
app.use(express.static('public', {
etag: true,
FROM node:12
LABEL author="Huong Nguyen (vnnvanhuong@gmail.com)"
# Use NODE_ENV=production to ensure that
# logging is kept to a minimum
# more caching levels takes
# don’t install dev node_modules
ARG NODE_ENV=production
ARG UID=999
ARG GUI=999
// DDP Server
// Use an implementation of WebSocket Server such as SockJS
ddpServer.socket = WebSocketServer
ddpServer.socket.onData = (msg) => {
switch(msg):
case 'connect':
check whether WebSocket connection
socket.send({msg: 'connected', ...})
case 'method':
result = methodsMap.get(msg.methodID).invoke()
@vnnvanhuong
vnnvanhuong / bitbucket-pipelines-axonivy.yml
Created October 29, 2017 10:06
bitbucket-pipelines-axonivy.yml
# This is a sample build configuration for Java (Maven).
# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: vnnvanhuong/axonivy-engine:7.0.1
pipelines:
default:
- step:
@vnnvanhuong
vnnvanhuong / pipelines-axonivy-pom.xml
Created October 29, 2017 10:03
pipelines-axonivy-pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>vn.nvanhuong</groupId>
<artifactId>pipelines-axonivy</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>iar</packaging>
<properties>
@vnnvanhuong
vnnvanhuong / axonivy-engine.Dockerfile
Last active October 29, 2017 10:43
axonivy-engine-dockerfile
FROM vnnvanhuong/maven-oracle-jdk:8
MAINTAINER Huong Nguyen vnnvanhuong@gmail.com
# Install wget, unzip
RUN apt-get update && \
apt-get install -y --no-install-recommends \
wget \
unzip
# Download and extract Axon.ivy Engine
@vnnvanhuong
vnnvanhuong / maven-oracle-jdk.Dockerfile
Last active August 21, 2020 06:45
maven-oracle-jdk-dockerfile
## Install Oracle Java 8
FROM ubuntu:16.04
MAINTAINER Huong Nguyen vnnvanhuong@gmail.com
# Update the package repository
RUN echo "deb http://archive.ubuntu.com/ubuntu xenial main universe" > /etc/apt/sources.list
RUN apt-get -y update
# Install python-software-properties
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python-software-properties software-properties-common
package vn.nvanhuong.hellojava.java8inaction;
import java.util.stream.IntStream;
public class MyMathUtils {
public static void main(String[] args) {
primes(numbers());
}
package vn.nvanhuong.coding.exercise;
import java.util.Scanner;
/**
* All squares (original & sub-squares) has these following characteristics:
* [1]. sorted entries
* + right entry - left entry = 1
* + below entry - above entry = dimension
* [2]. if we know smallest entry (T), dimension (N) & orientation -> we can know the rest entries
package vn.nvanhuong.java_lab;
//Inheritance from defined default methods
interface Foo{
default void method() {
System.out.println("Foo");
};
}
interface Bar{