Skip to content

Instantly share code, notes, and snippets.

@boraoren
boraoren / example.puml
Created March 31, 2020 05:44 — forked from QuantumGhost/example.puml
A simple template for PlantUML to draw ER diagram.The basic idea comes from http://plantuml.sourceforge.net/qa/?qa=331/database-modeling
@startuml
' uncomment the line below if you're using computer with a retina display
' skinparam dpi 300
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >>
' we use bold for primary key
' green color for unique
' and underscore for not_null
!define primary_key(x) <b>x</b>
!define unique(x) <color:green>x</color>
!define not_null(x) <u>x</u>

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Motivation

Integrate JMH (Java Microbenchmarking Harness) with Spring (Boot) and make developing and running benchmarks as easy and convinent as writing tests.

Idea

Wrap the necessary JMH boilerplate code within JUnit to benefit from all the existing test infrastructure Spring (Boot) provides. It should be as easy and convinent to write benchmarks as it is to write tests.

TL;DR;

@boraoren
boraoren / Remove all git tags
Created June 10, 2020 05:22 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
#Delete local tags.
git tag -l | xargs git tag -d
#Fetch remote tags.
git fetch
#Delete remote tags.
git tag -l | xargs -n 1 git push --delete origin
#Delete local tasg.
git tag -l | xargs git tag -d
@boraoren
boraoren / gist:4c5d3d924b223bb30f60c7b7818b8a64
Created August 25, 2020 23:56 — forked from 480/gist:3b41f449686a089f34edb45d00672f28
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@boraoren
boraoren / readme.md
Created October 15, 2020 01:00 — forked from astoilkov/readme.md
Async Operations with useReducer Hook

Async Operations with useReducer Hook

9 March, 2019

We were discussing with @erusev what we can do with async operation when using useReducer() in our application. Our app is simple and we don't want to use a state management library. All our requirements are satisfied with using one root useReducer(). The problem we are facing and don't know how to solve is async operations.

In a discussion with Dan Abramov he recommends Solution 3 but points out that things are fresh with hooks and there could be better ways of handling the problem.

Problem

@boraoren
boraoren / deployment.yml
Created November 18, 2020 07:59 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
public static long getWeekends(final LocalDate start, final LocalDate end) {
final DayOfWeek startDayOfWeek = start.getDayOfWeek();
final DayOfWeek endDayOfWeek = end.getDayOfWeek();
final long days = ChronoUnit.DAYS.between(start, end);
final long weekends = ((days + startDayOfWeek.getValue())/7);
return weekends + (endDayOfWeek == DayOfWeek.FRIDAY ? 1 : 0);
}
@boraoren
boraoren / amqp_vs_jms.md
Created July 15, 2022 01:42 — forked from danilobatistaqueiroz/amqp_vs_jms.md
Redis vs AMQP vs JMS vs Kafka

AMQP vs JMS

JMS: only java, it is a specification
AMPQ: universal, it is a protocol, it is open standard for messaging

JMS doesn't define a protocol.

JMS is an API and AMQP is a protocol.

AMQP supports 4 message models: Direct, Fanout, Topic, Headers