Skip to content

Instantly share code, notes, and snippets.

@sbcoba
sbcoba / README.md
Created October 19, 2015 06:56 — forked from hofmannsven/README.md
My simply Git Cheatsheet
import org.hibernate.cfg.Configuration;
import org.hibernate.cfg.ImprovedNamingStrategy;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.H2Dialect;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.type.classreading.MetadataReader;
import org.springframework.core.type.classreading.SimpleMetadataReaderFactory;
import org.springframework.util.FileCopyUtils;
import org.junit.Test;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.retry.support.RetryTemplate;
import org.springframework.util.FileCopyUtils;
import org.springframework.util.FileSystemUtils;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import org.openjdk.jmh.annotations.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;
@Warmup(iterations = 5)
@Measurement(iterations = 10)
@Fork(1)
@sbcoba
sbcoba / Thymeleaf3AutoConfiguration.java
Last active May 18, 2016 16:56
For Thymeleaf3 AutoConfiguration
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.template.TemplateLocation;
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafProperties;
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -
sudo yum install -y nodejs
sudo yum install -y git
sudo npm install -g bower
bower install commonjs
@sbcoba
sbcoba / NotifyUtils.java
Created June 18, 2016 07:55
Java String Unicode converter
public static String unicodeConvert(String str) {
StringBuilder sb = new StringBuilder();
char ch;
int len = str.length();
for (int i = 0; i < len; i++) {
ch = str.charAt(i);
if (ch == '\\' && str.charAt(i + 1) == 'u') {
sb.append((char) Integer.parseInt(str.substring(i + 2, i + 6), 16));
i += 5;
continue;
@sbcoba
sbcoba / 참고.sh
Created August 23, 2016 00:13 — forked from arahansa/참고.sh
ec2에 자바+톰캣 설치
# 아마존 자바8 설치. 아마존 리눅스
# http://blog.de-gouveia.eu/2014/05/21/java-8-jdk-linux-installation-in-ec2-linux-instance/
# http://tecadmin.net/install-java-8-on-centos-rhel-and-fedora/
# tomcat8http://tecadmin.net/install-tomcat-8-on-centos-rhel-and-ubuntu/
# http://tecadmin.net/install-tomcat-8-on-centos-rhel-and-ubuntu/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz"
tar xzf jdk-8u91-linux-x64.tar.gz
@sbcoba
sbcoba / JpaEntityDdlExport.java
Last active March 13, 2023 16:04
JPA Entity to DDL Generator ( Hibernate 5.x )
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardServiceRegistry;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.dialect.Dialect;
import org.hibernate.dialect.MySQL5InnoDBDialect;
import org.hibernate.tool.hbm2ddl.SchemaExport;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;