Skip to content

Instantly share code, notes, and snippets.

@sjyun
sjyun / build.gradle
Created November 9, 2017 06:32
gradle3-boot1.5
/*
buildscript{
repositories{
mavenCentral()
}
dependencies{
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.3.RELEASE")
}
}
@sjyun
sjyun / jsonp
Created November 7, 2017 09:20
jsonp
@ControllerAdvice
public class JsonPControllerAdvice extends AbstractJsonpResponseBodyAdvice{
/*
public JsonPControllerAdvice(String... queryParamNames) {
super(queryParamNames);
}
*/
public JsonPControllerAdvice(){
super("bootCallback");
}
@sjyun
sjyun / bootstrap1.html
Created October 31, 2017 07:56
bootstrap settting
<script src="https://npmcdn.com/tether@1.2.4/dist/js/tether.min.js"></script>
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.min.css"/>
System.out.println(arrays.tostring(TimeZone.getAvailableIds()));
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
df.setTimeZone(TimeZone.getTimeZone ( "Asia/Seoul" ));
mapper.setDateFormat(df);
@sjyun
sjyun / webjar.txt
Created October 30, 2017 09:41
web.jar
<link href="/webjars/materializecss/0.96.0/css/materialize.css" type="text/css" rel="stylesheet" media="screen,projection"/>
<script src="/webjars/jquery/2.1.4/jquery.js"></script>
<script src="/webjars/materializecss/0.96.0/js/materialize.js"></script>
@sjyun
sjyun / WebResourceConfig.java
Last active November 2, 2017 09:17
spring static resource serving
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {
@Autowired
private Environment env;
@Bean
public ResourceUrlEncodingFilter resourceUrlEncodingFilter() {
return new ResourceUrlEncodingFilter();
}
@sjyun
sjyun / build.gradle
Created October 24, 2017 06:09
boot front jar
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator', version:'1.5.2.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version:'1.5.2.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web', version:'1.5.2.RELEASE'
compile group: 'org.springframework.security.oauth', name: 'spring-security-oauth2', version:'2.0.13.RELEASE'
compile group: 'org.webjars', name: 'angularjs', version:'1.4.3'
compile group: 'org.webjars', name: 'jquery', version:'2.1.1'
compile group: 'org.webjars', name: 'bootstrap', version:'3.2.0'
compile group: 'org.webjars', name: 'webjars-locator', version:'0.32'
testCompile(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version:'1.5.2.RELEASE') {
exclude(module: 'commons-logging')
@sjyun
sjyun / checkfunction.js
Created May 17, 2017 17:53
function wrapperObject
(function(){
var car = {
beep: function beep(){
alert('beep');
},
brake: function brake(){
alert('stop');
},
accel: function accel(){
@sjyun
sjyun / hogan_sample.html
Created April 27, 2017 23:17
hogan_sample
<!DOCTYPE html>
<html lang="ko">
<head>
<title>Single Page</title>
<script src="http://twitter.github.com/hogan.js/builds/3.0.1/hogan-3.0.1.js"></script>
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<style type="text/css">
h2 {color:red;}
p {color:blue;}
.innerDiv { border:1px solid pink; padding:10px; }
@sjyun
sjyun / btnComp.html
Created March 17, 2017 09:06
html5 web component
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script>
var comp = Object.create(HTMLElement.prototype);
comp.createdCallback = function(){
var virtualDom = this.createShadowRoot();
var btn = document.createElement('button');