Skip to content

Instantly share code, notes, and snippets.

View vanduc1102's full-sized avatar
πŸ›
πŸ’― πŸ’― πŸ’© πŸ˜† 🐒

Duke Nguyen vanduc1102

πŸ›
πŸ’― πŸ’― πŸ’© πŸ˜† 🐒
View GitHub Profile

Keybase proof

I hereby claim:

  • I am vanduc1102 on github.
  • I am vanducld (https://keybase.io/vanducld) on keybase.
  • I have a public key ASBqgX1ABCNQBvyOaNsjefVHLjbSb0LqyMHa1eeuVpQkZQo

To claim this, I am signing this object:

#!/bin/sh
$WORKSPACE=/path/to/179/server
cd $WORSPACE
git reset --hard HEAD
git checkout develop
git pull
npm install
@vanduc1102
vanduc1102 / gcp_project_id.sh
Created July 6, 2019 08:26
Get project id in google cloud shell
echo $GOOGLE_CLOUD_PROJECT
echo $DEVSHELL_PROJECT_ID
export GCLOUD_PROJECT=${DEVSHELL_PROJECT_ID}
@vanduc1102
vanduc1102 / main.twig
Last active June 17, 2019 04:51
TWIG - Swap element in a loop , swapping 444 and 222
{# to run the code https://twigfiddle.com/ #}
{% set arr = [1, 2 , 3 , 444, 222, 5 ,6 ,7 ,8 ,9]%}
{% set temp = null %}
{% for item in arr %}
{% if item == 444 %}
{% set temp = item %}
{% set item = arr[loop.index0 +1 ] %}
#!/usr/bin/env bash
ENV=production
PROJECT_ID=xxxxxxx
REGION=us-central1
echo "==================================${ENV}=========================="
const log4js = require('log4js');
const LOG_LEVEL = process.env.LOG_LEVEL || 'debug';
if (LOG_LEVEL === 'debug') {
log4js.configure({
appenders: {
out: { type: 'stdout',
layout: {
type: 'pattern',
@vanduc1102
vanduc1102 / Docker-slim
Last active April 10, 2019 04:11
Dockerfile for Java Spring boot project
# our base build image
FROM maven:3.6-jdk-8-alpine as maven
# copy the project files
COPY ./pom.xml ./pom.xml
# build all dependencies
RUN mvn dependency:go-offline -B
# copy your other files
@vanduc1102
vanduc1102 / cloudbuild.yml
Created April 6, 2019 04:06
cloudbuild.yaml file example for deploying ReactJS project on Cloud Storage
# This is script for https://cloud.google.com/cloud-build/
steps:
# Install
- name: 'gcr.io/cloud-builders/yarn'
args: ['install']
# Lint
- name: 'gcr.io/cloud-builders/yarn'
args: ['run', 'lint']
# Test
- name: 'gcr.io/cloud-builders/yarn'
@vanduc1102
vanduc1102 / cors-json-file.json
Last active April 29, 2019 05:59
Gooogle Cloud Storage CORS
[{
"origin": [
"*"
],
"responseHeader": [
"*"
],
"method": [
"*"
],