Skip to content

Instantly share code, notes, and snippets.

Van Huong vnnvanhuong

Block or report user

Report or block vnnvanhuong

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View meteor-ddp-pseudo.js
// 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 Oct 29, 2017
bitbucket-pipelines-axonivy.yml
View 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:
View 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 Oct 29, 2017
axonivy-engine-dockerfile
View 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 Oct 29, 2017
maven-oracle-jdk-dockerfile
View 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
View MyMathUtils.java
package vn.nvanhuong.hellojava.java8inaction;
import java.util.stream.IntStream;
public class MyMathUtils {
public static void main(String[] args) {
primes(numbers());
}
View Coding Exercise.java
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
View MultiInheritance.java
package vn.nvanhuong.java_lab;
//Inheritance from defined default methods
interface Foo{
default void method() {
System.out.println("Foo");
};
}
interface Bar{
View StrategyVsTemplateMethod.java
//Which the same way to solve a problem
//Template Method uses Inheritance
//Strategy uses Composition/Delegation
abstract class TemplateMethod{
public final void execute() {
doFirstThing();
doSecondthing();
}
//modifier can be public, private, protected
View TemplateMethodDemo.java
abstract class AbstractDocumentGenerator{
//THIS IS TEMPLATE METHOD
public final File generate() {
Document defaultDocument = prepareDocumentByDefault();
Document refinedDocument = redefineDocument(defaultDocument);
String templatePath = getTemplatePath();
String outputName = getOutputName();
return DocFactory.generate(refinedDocument, templatePath, outputName);
}
You can’t perform that action at this time.