Skip to content

Instantly share code, notes, and snippets.

View polunzh's full-sized avatar
🎯
Focusing

zhenqiang polunzh

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am polunzh on github.
  • I am polunzh (https://keybase.io/polunzh) on keybase.
  • I have a public key ASBT8HHKNRxT2uFxlftaPnByQN5ED7cSNcG7CJbhf8xD9Qo

To claim this, I am signing this object:

[alias]
st = status
ch = checkout
br = branch
ci = commit
@polunzh
polunzh / tlthistory
Created February 19, 2018 07:13
tlthistory
tlthistory
'use strict'
/**
* 该函数将传入的数组整理成 [小于等于v的数],v,[大于v的数], v为数组的第一个数;
* 如果传入的不是数组,则会抛出异常
*
* @param {any} array
* @returns
*/
function part(array) {
# For more options and information see
# http://rpf.io/configtxtreadme
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
@polunzh
polunzh / express.md
Created January 10, 2017 14:26 — forked from dlutwuwei/express.md
express4.2源码解析

title: express4.2源码解析 date: 2014-05-18 15:00:50 categories: express tags: [nodejs, node, js, express]

express是nodejs平台上一个非常流行的框架,4.2.0是最新的版本,相比3.x版本优化了代码和api,去除了connect模块,自己实现了一个router组件,实现http请求的顺序流程处理,去除了很多绑定的中间件,使代码更清晰。

##1.使用express 如何使用express在官网有很好的讲解,只用experssjs实例app的几个函数,就可以构建构建web程序。

@polunzh
polunzh / Delete all documents in a Solr index using curl.sh
Created September 29, 2016 04:44 — forked from nz/Delete all documents in a Solr index using curl.md
Delete all documents in a Solr index using curl
# http://wiki.apache.org/solr/FAQ#How_can_I_delete_all_documents_from_my_index.3F
# http://wiki.apache.org/solr/UpdateXmlMessages#Updating_a_Data_Record_via_curl
curl http://index.websolr.com/solr/a0b1c2d3/update -H "Content-Type: text/xml" --data-binary '<delete><query>*:*</query></delete>'
@polunzh
polunzh / image2Base64.js
Created May 10, 2016 08:53
cordova image to base64
function readData(imageURI) {
function gotFileEntry(fileEntry) {
console.log("got image file entry: " + fileEntry.fullPath);
fileEntry.file(function (file) {
var reader = new FileReader();
reader.onloadend = function (evt) {
console.log(evt.target.result);
};
//reader.readAsText(file);

解决 Git 在 windows 下中文乱码的问题

原因

中文乱码的根源在于 windows 基于一些历史原因无法全面支持 utf-8 编码格式,并且也无法通过有效手段令其全面支持。

解决方案

  1. 安装
@polunzh
polunzh / pre-commit
Last active September 4, 2017 15:30 — forked from arnobroekhof/pre-commit
Maven pre commit hook
#!/bin/bash
# 放在 <git_directory>/.git/hooks/pre-commit
echo "执行 Maven clean test 检查单元测试是否通过..."
# retrieving current working directory
CWD=`pwd`
MAIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# 返回项目主目录
cd $MAIN_DIR/../../