Skip to content

Instantly share code, notes, and snippets.

View PavithMadusara's full-sized avatar
🏠
Working from home

Pavith Madusara PavithMadusara

🏠
Working from home
View GitHub Profile
@PavithMadusara
PavithMadusara / oauth2-keycloak-spring-microservice-config.md
Created February 25, 2022 06:36
Spring Boot Microservice M2M and Token Relay with Keycloak

Spring Boot Security Configuration for Microservices with Keycloak for Token Relay and OAuth2

Secure Microservice with Keycloak (+ Token Relay)

After this steps, you can use KeycloakRestTemplate to access the secured microservice (Relay the Token). However, this only works if the request is initialized by a user. See OAuth2 WebClient Configuration for Sending requests from Microservice to Microservice.

  • Add following dependencies to your project
<depencencies>
@PavithMadusara
PavithMadusara / jmswsjaxrs.md
Last active August 16, 2021 06:31
JMS-WS-JAXRS
  • JMSConnector.java
import javax.jms.Connection;
import javax.jms.MessageConsumer;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicConnectionFactory;
import javax.naming.Context;
import javax.naming.InitialContext;
@PavithMadusara
PavithMadusara / android_location_picker.md
Last active August 8, 2021 16:52
Android Location Picker

implementation 'com.google.android.gms:play-services-maps:16.0.1'

import android.Manifest;
import android.annotation.TargetApi;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
@PavithMadusara
PavithMadusara / electron-angular-serialport.md
Created April 6, 2021 16:43
ElectronJS with Angular and Serialport

Electron with Angular and Serialport

Install Angular CLI

npm i -g @angular/cli

Create Angular Application

@PavithMadusara
PavithMadusara / typorm-sqlite-electron-angular.md
Last active January 16, 2023 14:38
How to Create Eleactron app with Angular 11, TypeORM and SQLite3 (2021.01)

Electron - Angular 11 - SQLite3 - TypeORM

Angular 11 implementation of CubikNeRubik angular-electron-typeorm-starter project

Create Angular Application Using Angular CLI

ng new APP-NAME --routing --style=scss
@PavithMadusara
PavithMadusara / typeorm-on-electron-renderer.md
Last active November 23, 2022 10:52
How to setup ElectronJS project with ReactJS, AntD, Tailwind, TypeORM and SQlite3 (TypeORM on Renderer Process)
Generate with Electron Forge

yarn create electron-app app-name --template=typescript-webpack

Add React,Typeorm,sqlite3 and AntD

yarn add react react-dom react-router-dom antd typeorm sqlite3 reflect-metadata

Add Dev Dependencies

yarn add -D @babel/core babel-loader @babel/preset-env @babel/preset-react @types/react @types/react-dom @types/react-router-dom postcss postcss-loader babel-loader file-loader mini-css-extract-plugin

Add TailwindCSS
@PavithMadusara
PavithMadusara / electron-react-serialport.md
Last active March 19, 2023 16:01
Electron Application with Node Serial Port and React

npm create electron-app app-name --template=webpack

Install Node Serial

npm install serialport npm i -D electron-rebuild

Add this to package.json scrips

"install":"electron-rebuild"