This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File.open('a2.xml','r').read.force_encoding('BIG5').encode('UTF-8', invalid: :replace, undef: :replace, replace: "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
date=`date +%Y-%m-%d` | |
RETENTION_PERIOD="7" | |
HEADER="Backup data" | |
remove_oldfiles(){ | |
echo "Removing directory $1 files older than $RETENTION_PERIOD days" | wall | |
find $1 -type f -mtime +$2 -exec rm '{}' \; | |
} | |
BACKUPDIR="/disk0/svn_backup/001/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.pagination > a, .pagination > span { | |
background-color: #fff; | |
border: 1px solid #ddd; | |
color: #428bca; | |
float: left; | |
line-height: 1.42857; | |
margin-left: -1px; | |
padding: 6px 12px; | |
position: relative; | |
text-decoration: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def domain = model(com.foo.Bar) | |
domain.className == "FooBar" | |
domain.fullName == "com.foo.FooBar" | |
domain.packageName == "com.foo" | |
domain.packagePath == "com/foo" | |
domain.propertyName == "fooBar" | |
domain.lowerCaseName == "foo-bar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
applaction.yml | |
dataSource: | |
url: jdbc:mysql://127.0.0.1:3306/databases?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull | |
my.cnf | |
[client] | |
default-character-set = utf8mb4 | |
[mysql] | |
default-character-set = utf8mb4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Resource name="jdbc/druid-test" | |
auth="Container" | |
type="javax.sql.DataSource" | |
username="sa" | |
password="password" | |
driverClassName="net.sourceforge.jtds.jdbc.Driver" | |
factory="com.alibaba.druid.pool.DruidDataSourceFactory" | |
maxActive="3" | |
maxIdle="3" | |
maxWait="10000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.alibaba.druid.support.http.StatViewServlet | |
import grails.boot.GrailsApp | |
import grails.boot.config.GrailsAutoConfiguration | |
import org.springframework.boot.context.embedded.ServletRegistrationBean | |
import org.springframework.context.annotation.Bean | |
class Application extends GrailsAutoConfiguration { | |
@Bean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place your Spring DSL code here | |
beans = { | |
dataSource(com.alibaba.druid.pool.DruidDataSource) { | |
url = "${grailsApplication.config.dataSource.url}" | |
username = "${grailsApplication.config.dataSource.username}" | |
password = "${grailsApplication.config.dataSource.password}" | |
maxActive = "${grailsApplication.config.dataSource.maxActive ? grailsApplication.config.dataSource.maxActive : "2"}" | |
filters = "stat" | |
validationQuery = "select 1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.zaxxer.hikari.HikariConfig | |
import com.zaxxer.hikari.HikariDataSource | |
// Place your Spring DSL code here | |
beans = { | |
def config = application.config | |
println config | |
def dataSources = config.findAll { | |
pritnln it.key.toString() | |
it.key.toString().contains("dataSource") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
filetype off | |
filetype plugin indent off | |
set runtimepath+=$GOROOT/misc/vim | |
set encoding=utf-8 | |
set rtp+=~/.vim/bundle/vundle/ | |
call vundle#rc() | |
set tabstop=4 | |
set shiftwidth=4 |
NewerOlder