Skip to content

Instantly share code, notes, and snippets.

@Mukundhan-I2I
Mukundhan-I2I / java validations
Created May 6, 2020 14:49
java validations
https://www.sitepoint.com/using-java-bean-validation-method-parameters-return-values/
https://github.com/eugenp/tutorials
@Mukundhan-I2I
Mukundhan-I2I / StaticContextAccessor
Created September 10, 2019 08:07
StaticContextAccessor
package com.ntst.services.mobile.util;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
/**
* <p>
@cardil
cardil / JEP.md
Last active May 16, 2024 21:17
[Draft] JEP - Change name of imported type (aliasing)

Summary

Change name of imported type (aliasing)

Goals

The goal is to make code more productive and clean in cases where multiple classes with same name must be used in code. It should relief a developers frustration in that

@pleunv
pleunv / babel-preset-react-app.js
Last active February 24, 2020 12:34
webpack 4 dev config
/* eslint-disable import/no-extraneous-dependencies, prefer-template */
// const validateBoolOption = (name, value, defaultValue) => {
// if (typeof value === 'undefined') {
// value = defaultValue;
// }
// if (typeof value !== 'boolean') {
// throw new Error(`Preset react-app: '${name}' option must be a boolean.`);
// }
@pengisgood
pengisgood / checkstyle.xml
Created February 28, 2018 05:51
checkstyle 8.1 example
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
@lovio
lovio / actions.products.js
Last active November 20, 2018 11:30
redux-sagas utils
import { createConstAndAction, createFetchTypesAndFuncs } from './utils';
export const { PRODUCTS, products } = createFetchTypesAndFuncs('products');
export const { LOAD_PRODUCTS, loadProducts } = createConstAndAction('LOAD_PRODUCTS');
// these actions is for pull-to-load-more
export const { LOAD_MORE_PRODUCTS, loadMoreProducts } = createConstAndAction('LOAD_MORE_PRODUCTS');
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@kazimuth
kazimuth / lgconfig.sh
Last active May 25, 2019 07:48
git lg
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@zeuxisoo
zeuxisoo / gist:980174
Created May 19, 2011 04:15
How to use git diff to patch file

Create patch file

git diff --no-prefix > [path file name]

Apply path file

patch -p0 < [path file name]