Skip to content

Instantly share code, notes, and snippets.

View 0532's full-sized avatar
🇨🇳

wanglichao 0532

🇨🇳
View GitHub Profile
@0532
0532 / FtpClient.java
Last active August 29, 2015 14:25
FTP读取服务器文件
package rfm.ta.test;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPClientConfig;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@0532
0532 / XmlToBean.java
Created July 6, 2015 14:20
把xml中各字段的值赋值到对应的bean中
package rfm.ta.gateway.sbs.helper;
import org.apache.commons.lang.StringUtils;
import rfm.ta.gateway.hfnb.model.txn.TaHfnbTiaXml2002;
import rfm.ta.test.Bean20002Test;
import java.lang.reflect.Field;
import java.math.BigDecimal;
/**
@0532
0532 / lang.py
Created June 2, 2015 02:30
sublime commit
# -*- coding: UTF-8 -*-
import requests
def getLang(user):
re = requests.get('https://api.github.com/users/'+user+'/repos')
if 200 == re.status_code:
for k,v in enumerate(re.json()):
print v['name'],v['language']
if __name__ == '__main__':
@0532
0532 / SmsHelper.java
Created June 2, 2015 01:51
Socket Client Send sms
package clientTest.test;
import org.apache.commons.lang.StringUtils;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@0532
0532 / 1.html
Created April 14, 2015 03:54
github button 'star' 'fork' 'fellow' and 'fork me on github'
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="gh-fork-ribbon.css">
<link rel="stylesheet" href="style.css" />
<style>
.right .github-fork-ribbon {
background-color: #333;
}
</style>
@0532
0532 / convert.js
Created April 10, 2015 04:00
You can use this to convert a DOM element or a HTML string to markdown.
/*
You can use this to convert a DOM element or a HTML string to markdown.
Usage examples:
var markdown = toMarkdown(document.getElementById("content"));
// With jQuery you can easily convert HTML strings
var markdown = toMarkdown($("<ul><li>Hi!</li></ul>")[0]);
@0532
0532 / PoiExpXls.java
Last active August 29, 2015 14:18
poi导出excel的格式设置
public void onExpExcel() {
String[] excelHeader4 = {"代号", "名称", "金额", "代号", "名称", "金额"};
String[] excelHeader3 = {"支出项目", "收入项目"};
List<T623.Bean> dataList6 = new ArrayList<>();
List<T623.Bean> dataList5 = new ArrayList<>();
BigDecimal totexp = null;//支出合计
BigDecimal totrev = null;//收入合计
BigDecimal bene = null;//结益
BigDecimal loss = null;//结损
for (T623.Bean datas : dataList) {
@0532
0532 / SmsTemplate.java
Created April 2, 2015 13:58
send telephone message
/*
* Copyright 2010 by LongTop Corporation.
*
* All rights reserved.
*
* This software is the confidential and proprietary information of
* LongTop Corporation ("Confidential Information"). You
* shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with LongTop.
@0532
0532 / DataExpAction.java
Last active August 29, 2015 14:18
export data to excel using xls template
public String onExpExcel() {
try {
if (dataList == null || dataList.size() == 0) {
MessageUtil.addWarn("未查询数据!");
return null;
}
Map beansMap = new HashMap();
String excelFilename = "SBS损益表" + ".xls";
JxlsManager jxls = new JxlsManager();
beansMap.put("records", dataList);
@0532
0532 / lang.py
Created April 2, 2015 13:42
python获取github 项目language
# -*- coding: UTF-8 -*-
import requests
def getLang(user):
re = requests.get('https://api.github.com/users/'+user+'/repos')
if 200 == re.status_code:
for k,v in enumerate(re.json()):
print v['name'],v['language']
if __name__ == '__main__':