Skip to content

Instantly share code, notes, and snippets.

@mourjo
mourjo / docker-compose.yml
Last active April 13, 2024 21:23
Docker compose for a minimal Kibana + Elasticsearch locally
version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.1
container_name: es01
environment:
- node.name=es01
- cluster.name=es-docker-cluster
- discovery.type=single-node
- bootstrap.memory_lock=true
@hank-cp
hank-cp / NestedObjectComparator.java
Last active June 27, 2019 02:47
Javers complex @valueobject comparator
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.javers.core.diff.changetype.map.*;
import org.javers.core.diff.custom.CustomPropertyComparator;
import org.javers.core.json.JsonConverter;
import org.javers.core.metamodel.object.GlobalId;
import org.javers.core.metamodel.property.Property;
import java.util.ArrayList;
@vasanthk
vasanthk / System Design.md
Last active July 24, 2024 23:02
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@lemiorhan
lemiorhan / ReleaseViaJGitFlow.md
Last active October 21, 2023 03:57
How to make a release with Git and Maven via JGitFlow

How to make a release with Git and Maven via JGitFlow

Imagine that you are versioning your sourcecode in git and building your code via maven. You need to make releases before deploying to production regularly. What should be the strategy we need to follow for releasing?

I've used maven-release-plugin for years to make releases. It worked perfectly with maven and svn, but we started to face problems when we migrated our code to git and to make releases on git.

After checking the literature, we decided to use JGit-Flow which is a maven plugin based on and is a replacement for the maven-release-plugin enabling support for git-flow style releases via maven.

I do not want to explain the details much because there are many great posts explaining all.

@makolesnik
makolesnik / Selenide cheat sheet
Last active December 26, 2022 13:57
Selenide cheat sheet to create concise UI tests in Java. What is Selenide? Selenide is a wrapper for Selenium WebDriver. http://selenide.org/
=Navigating=
baseUrl = "http://site.com";
open("/login");
open("http://google.com");
switchTo().frame($("#myFrame").toWebElement());
=Alert=
switchTo().alert().accept();
@bradberger
bradberger / notZero.js
Last active September 27, 2016 08:15
A simple AngularJS directive to make sure a number is not zero. It sets the formName.elementName.$error.zero value accordingly.
/**
* @description A simple check to ensure a number is not zero. Sets the "zero" validation accordingly.
* @usage <input ng-model="myModel" not-zero>
*/
angular.module("app").directive("notZero", function() {
var linkFunc = function(scope, element, attrs, ngModel) {
var zeroValidator = function(value) {
var num = parseFloat(value);
@jedvardsson
jedvardsson / LabeledEnum.java
Created June 3, 2015 08:59
How to implement a custom Hibernate enum type indexed on a label
public interface LabeledEnum {
String getLabel();
}
@lolzballs
lolzballs / HelloWorld.java
Created March 22, 2015 00:21
Hello World Enterprise Edition
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
public class HelloWorld{
private static HelloWorld instance;
public static void main(String[] args){
instantiateHelloWorldMainClassAndRun();
@nbouherrou
nbouherrou / SvnToGit.md
Last active October 21, 2019 14:43
Migrate to Git from SVN
@jelies
jelies / CustomSchemaValidationConfiguration.java
Created February 12, 2014 08:33
Custom Hibernate schema validator that collects all the validation errors to display them all together instead of crashing one by one. Using Hibernate 3.6.4.
package com.jelies.hibernate.validation;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.TreeMap;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;