Skip to content

Instantly share code, notes, and snippets.

@ahhqcheng
ahhqcheng / pom.xml
Created September 25, 2013 03:26
maven编译文件的编码设置
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<!--java编译-->
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@ahhqcheng
ahhqcheng / Ipv4Util.java
Last active December 23, 2015 19:29
IP转整数以及整数转IP
/**
* 参考:http://aokunsang.iteye.com/blog/622498
* @author chengyongchun
* @since 2013-9-24 <br/>
*/
public class Ipv4Util {
public static Long ip2Long(String ipString){
if(ipString==null){
@ahhqcheng
ahhqcheng / gist:6239479
Created August 15, 2013 09:15
Ext对于表格中的字过长,当鼠标移上去显示全部信息的实现方式
{
header: 'id',
dataIndex: 'id',
hidden: false,
flex: 2.5,
renderer:function(before,metadata,r){
var value = before.replace(/\n/g,'</br>');
metadata.tdAttr = 'data-qtip="' + value + '"';
return before.replace(/\n/g,'&nbsp;');
}
@ahhqcheng
ahhqcheng / gist:6237465
Created August 15, 2013 01:31
Ext.data.Store
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [
{name: 'firstName', type: 'string'},
{name: 'lastName', type: 'string'},
{name: 'age', type: 'int'},
{name: 'eyeColor', type: 'string'}
]
});
@ahhqcheng
ahhqcheng / adhoc
Created June 9, 2013 14:11 — forked from anonymous/adhoc
#!/bin/bash
#####################################
#Author: Leon Lee #
#email: lendylongli@gmail.com #
#QQ: 730395591 #
#Version: 1.0 #
#Note: If you have some good ideas #
# or advice, please mail me^^ #
#####################################
/* 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
# 1. Make sure you have nginx sub module compiled in
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module'
# 2. add two directives below at HTTP level
# nginx.conf
http {
# ......
sub_filter '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); } img { _filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=0); -webkit-filter: grayscale(100%); } </style>';