Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Emmanuel Balpe m4nu56

🏠
Working from home
View GitHub Profile
View update_postgres_subquery.sql
UPDATE journey_patterns p SET name = (
SELECT l.name
FROM journey_patterns jp
JOIN routes r ON jp.route_id = r.id
JOIN lines l ON r.line_id = l.id
WHERE l.name IS NOT NULL
AND l.name <> ''
AND jp.id = p.id
) || ' - ' || name
@m4nu56
m4nu56 / ApiService.java
Last active May 29, 2020
Using Generic Types in Java to create a method that will handle any API call
View ApiService.java
package com.dev1.api;
import com.dev1.api.exception.ApiException;
import com.dev1.api.exception.ApiExceptionNetwork;
import com.dev1.api.exception.ApiExceptionUncaught;
import com.dev1.api.exception.mapper.ErrorMessage;
import com.google.common.collect.ImmutableList;
import org.apache.http.HttpHeaders;
import org.apache.log4j.Logger;
@m4nu56
m4nu56 / ReflectionClassFields.java
Last active Nov 21, 2019
Map the fields of a class into a Map with fieldName and fieldValue
View ReflectionClassFields.java
import org.apache.commons.lang3.tuple.Pair;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ReflectionClassFields {
@m4nu56
m4nu56 / .gitlab-ci.yml
Created Nov 12, 2019
Pipeline tests nodejs+mongodb + integration tests avec postman
View .gitlab-ci.yml
image: docker:19.03.1
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
PROJECT_IMAGE: registry.dev1-0.com/project
PROJECT_RELEASE_IMAGE: $PROJECT_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_TLS_CERTDIR: ""
services:
@m4nu56
m4nu56 / config.json
Created Nov 11, 2019
Config for ouroboros auth to registry
View config.json
{
"auths": {
"registry.domain.com": {
"auth": "tokenXXXX"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.0 (linux)"
}
}
@m4nu56
m4nu56 / docker-compose.yml
Last active Nov 11, 2019
Config ouroboros
View docker-compose.yml
version: '3'
services:
ouroboros:
container_name: ouroboros
hostname: ouroboros
image: pyouroboros/ouroboros
environment:
- CLEANUP=true
- INTERVAL=300
- LOG_LEVEL=info
@m4nu56
m4nu56 / docker-compose.yml
Last active Nov 11, 2019
Stack mongo + nodejs
View docker-compose.yml
version: "3.4"
services:
mongo:
container_name: mongo
image: mongo:4.0
restart: unless-stopped
ports:
- 27017:27017
environment:
View Dockerfile
FROM node:10
ENV TZ=Europe/Paris
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get install -y build-essential && apt-get install -y python
# Create app directory
WORKDIR /usr/src/app
View .gitlab-ci.yml
image: docker:19.03.1
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
PROJECT_IMAGE: registry.domain.com/project-name
PROJECT_RELEASE_IMAGE: $PROJECT_IMAGE:$CI_COMMIT_REF_NAME
DOCKER_TLS_CERTDIR: ""
services:
You can’t perform that action at this time.