Skip to content

Instantly share code, notes, and snippets.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@sbcoba
sbcoba / bash_to_zsh_history.rb
Created June 5, 2017 07:27 — forked from goyalankit/bash_to_zsh_history.rb
Import bash history to zsh history.
#################################################################
# = This script transfers bash history to zsh history
# = Change bash and zsh history files, if you don't use defaults
#
# = Usage: ruby bash_to_zsh_history.rb
#
# = Author: Ankit Goyal
#################################################################
# change if you don't use default values
sudo yum update
sudo yum install -y java-1.8.0-openjdk-devel
sudo yum remove -y java-1.7.0-openjdk
sudo yum install -y git
sudo yum install -y zsh
sudo su -
# ec2-user 패스워드 설정
passwd ec2-user
exit
# oh my zsh 설치
@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;
@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 / 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;
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 / 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;
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)
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;