Skip to content

Instantly share code, notes, and snippets.

View bijay-shrestha's full-sized avatar
👨‍🎓
MSCS Compro

Bijay Shrestha bijay-shrestha

👨‍🎓
MSCS Compro
View GitHub Profile
@bijay-shrestha
bijay-shrestha / momentjs.txt
Last active June 5, 2019 07:21
JavaScript Date manipulation with MomentJS
https://www.sitepoint.com/managing-dates-times-using-moment-js/
http://zetcode.com/javascript/momentjs/
@bijay-shrestha
bijay-shrestha / Markdown.md
Last active June 11, 2019 22:59
Markdown Formats

Markdown is a lightweight and easy-to-use syntax for styling all forms of writing on the GitHub platform.

What you will learn:

-How the Markdown format makes styled collaborative editing easy -How Markdown differs from traditional formatting approaches -How to use Markdown to format text -How to leverage GitHub’s automatic Markdown rendering -How to apply GitHub’s unique Markdown extensions

@bijay-shrestha
bijay-shrestha / tree.md
Last active June 12, 2019 05:09
tree: ignore directories with patterns

tree: ignore directories with patterns

tree displays the directory structure of the current directory. -d option displays only directories. -I option allows to exclude directories that match specific pattern e.g.

tree -I node_modules

In order to exclude multiple directories at once, their names must be separated by | sign, i.e.

no suitable HttpMessageConverter found

org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for 
response type [class com.example.demo.model.Car] and content type [text/html;charset=utf-8]

Solution

Add

 

Install Babel core and cli

npm install --save-dev @babel/core @babel/cli
npm install babel-preset-react-app --save-dev

Monorepo setup with Lerna and Yarn workspaces

Lerna

Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and npm.

Lerna tries to ease the management of npm links when dealing with multi package projects hosted in a single repository. It analyzes the packages and automatically creates the required npm links between them. It also handles execution of tasks across multiple packages and eases the pain of versioning and publishing. It has its shortcomings but it’s worth using it. Big projects like Babel and Jest use Lerna.

# Created by https://www.gitignore.io/api/node,bower,osx,linux,windows,dropbox,sass,less,grunt,sublimetext,code

### Node ###
# Logs
logs
*.log
npm-debug.log*

# Runtime data
@bijay-shrestha
bijay-shrestha / Spring Boot.md
Last active June 30, 2019 07:05
The gist is a complete guide to`why's` of Spring Boot

What is the spring-boot-configuration-processor ?

Doing so, scans the libraries in the build and sees what properties they use so as to inform the IDE

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-configuration-processor</artifactId>
	<optional>true</optional>
</dependency>

What is Consul?

Consul is a distributed service mesh to connect, secure, and configure services across any runtime platform and public or private cloud

Consul Installation and usage

  1. Download and install Consul on Ubuntu 18.04 from here
@bijay-shrestha
bijay-shrestha / DatabasesConfig.java
Created July 1, 2019 06:49 — forked from mismatch/DatabasesConfig.java
Spring Boot. Multiple datasources configuration example
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;