Skip to content

Instantly share code, notes, and snippets.

@jampajeen
jampajeen / hikaricp-sqlserver-datasource
Created March 27, 2016 11:37
Create spring datasource for SQL Server & HikariCP
jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.url=jdbc:sqlserver://localhost:1433;databaseName=test
jdbc.username=myuser
jdbc.password=mypass
hikariCP.dataSourceClassName=com.microsoft.sqlserver.jdbc.SQLServerDataSource
@Bean
public DataSource dataSource(@Value("${hikariCP.dataSourceClassName}") String dataSourceClassName,
@Value("${jdbc.url}") String url,
@jampajeen
jampajeen / InternalAuthTokenGenerator.java
Created February 20, 2016 04:00
Generate oauth token
/*
* Copyright 2016 Thitipong Jampajeen <[email protected]>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@jampajeen
jampajeen / LC_CTYPE.txt
Created November 21, 2015 13:02
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@jampajeen
jampajeen / jira-behing-nginx-ssl
Created November 15, 2015 18:06 — forked from alertor/jira-behing-nginx-ssl
Atlassian JIRA behind nginx + SSL
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
/bin/dd if=/dev/zero of=out.tmp bs=1M count=2048
@jampajeen
jampajeen / gist:9ce8876ae829efd69aaa
Last active October 27, 2016 21:14
Hibernate non-entity mapping
Query query = session.createSQLQuery(sql);
query.setResultTransformer( Transformers.aliasToBean( Test.class) );
List<Test> result = query.list();