Skip to content

Instantly share code, notes, and snippets.

View dvsingh9's full-sized avatar
🪀
Focusing

DV Singh dvsingh9

🪀
Focusing
View GitHub Profile
# This power shell script can be used to setup developer machine for java and related frameworks
function Install-Chololatey {
Write-Host "Installing Chocolatey ..."
Set-ExecutionPolicy Bypass -Scope Process -Force;
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
}
function Install-JDK {
choco install openjdk17 -y --version="17.0.2" --allow-downgrade
import com.google.protobuf.Descriptors;
import com.google.protobuf.GeneratedMessageV3;
import io.quarkus.jsonb.JsonbConfigCustomizer;
import javax.inject.Singleton;
import javax.json.bind.JsonbConfig;
import javax.json.bind.serializer.JsonbSerializer;
import javax.json.bind.serializer.SerializationContext;
import javax.json.stream.JsonGenerator;
import java.util.Map;
import com.google.protobuf.Descriptors;
import com.google.protobuf.GeneratedMessageV3;
import io.quarkus.jsonb.JsonbConfigCustomizer;
import javax.inject.Singleton;
import javax.json.bind.JsonbConfig;
import javax.json.bind.serializer.JsonbSerializer;
import javax.json.bind.serializer.SerializationContext;
import javax.json.stream.JsonGenerator;
import java.util.Map;
import { Injectable } from '@angular/core';
export const S3_BUCKET = 'semuaproduk-data';
export const BASE_URL = 'https://d19la03daa7iyw.cloudfront.net/';
@Injectable({
providedIn: 'root'
})
export class ImageHandlerService {
@dvsingh9
dvsingh9 / spring.boot.90mb.Dockerfile
Created May 3, 2020 17:35
Spring boot ultra slim (less than 90 mb) docker build script
# (1) use Alpine Linux for build stage
FROM alpine:3.11.3 as build
# (2) install build dependencies
RUN apk --no-cache add openjdk11
RUN apk --no-cache add maven
# build JDK with less modules
RUN /usr/lib/jvm/default-jvm/bin/jlink \
--compress=2 \
--module-path /usr/lib/jvm/default-jvm/jmods \
@dvsingh9
dvsingh9 / spring.boot.gitlab-ci.yml
Created May 3, 2020 17:32
Gitlab CI/CD to deploy a Spring Boot application in AWS ECS with auto service restart
image: docker:latest
variables:
REGION: [aws region]
REPOSITORY_URL: [your ECR repository url]
REPOSITORY_NAME: [repository name]
UAT_CLUSTER_NAME: [ECS Cluster name]
UAT_SERVICE_NAME: [service name]
@dvsingh9
dvsingh9 / network.service.ts
Last active July 18, 2022 18:04
Network Service for ionic - to identity android/iOS device is Offline/Online
import { Injectable } from '@angular/core';
import { Network } from '@ionic-native/network/ngx'
import { BehaviorSubject, Observable } from 'rxjs';
import { ToastController, Platform } from '@ionic/angular';
export enum ConnectionStatus {
Online,
Offline
}
@dvsingh9
dvsingh9 / base.service.ts
Created May 2, 2020 17:08
TypeScript Generics - Base Service for http services
import * as _ from 'lodash';
import {Observable} from 'rxjs';
import {HttpClient, HttpParams} from '@angular/common/http';
import {share} from 'rxjs/operators';
import {PageableResponse} from '../modal/pageable-response.modal';
import {Search} from '../modal/search.modal';
export class BaseService<T> {
private http: HttpClient;
private url: string;