Skip to content

Instantly share code, notes, and snippets.

@Mukundhan-I2I
Mukundhan-I2I / checkstyle.xml
Created October 29, 2019 10:23 — forked from pengisgood/checkstyle.xml
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
@Mukundhan-I2I
Mukundhan-I2I / UnitTestUtils
Last active October 16, 2019 13:39
UnitTestUtils
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Mukundhan-I2I
Mukundhan-I2I / callback java
Created September 23, 2019 11:56
callback in java
public class WithIndex<T> {
private int index;
private T value;
WithIndex(int index, T value) {
this.index = index;
this.value = value;
}
public int index() {
@Mukundhan-I2I
Mukundhan-I2I / gist:3179fa725a9d49a4bac68a7c9e3a8c3d
Created September 20, 2019 08:42 — forked from zeuxisoo/gist:980174
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]

@Mukundhan-I2I
Mukundhan-I2I / TypeScript
Created September 12, 2019 17:18
TypeScript 101
https://github.com/microsoft/TypeScriptSamples
@Mukundhan-I2I
Mukundhan-I2I / access-denied
Created September 11, 2019 07:57
Access denied for user 'root'@'localhost'
sudo mysql -u root
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'test';
@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>
@Mukundhan-I2I
Mukundhan-I2I / checkstyle intlellij
Created September 10, 2019 07:06
checkstyle intlellij
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that enforces deVero conventions during build time
-->
@Mukundhan-I2I
Mukundhan-I2I / GenericClass
Created September 9, 2019 10:42
Generic method call using reflection
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.HashMap;
https://stackoverflow.com/questions/6680674/can-a-java-class-add-a-method-to-itself-at-runtime
public class GenericClass {
private HashMap<String, Method> methodMap = new HashMap<String, Method>();
will set these permissions to all files and
sudo chmod -R 755 *
sudo chmod 755 -R /opt/lampp/htdocs
-R - recursive ??