Skip to content

Instantly share code, notes, and snippets.

View lengyf's full-sized avatar

Yuefeng Leng lengyf

  • Jinan,Shandong,China
View GitHub Profile
@lengyf
lengyf / is_en.js
Created March 26, 2019 03:33
JS判断字符串是否是英文
function isEn (value) {
let _value = value.replace(/\s/g, '')
if (encodeURI(_value).length === _value.length) {
return true
}
return false
}
@lengyf
lengyf / ExcelUtil.java
Last active January 21, 2016 02:21 — forked from madan712/ReadWriteExcelFile.java
Read / Write Excel file (.xls or .xlsx) using Apache POI
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
@lengyf
lengyf / java_daemon_stop.sh
Last active December 16, 2015 03:49
Shell for how to stop a Java daemon
#!/bin/sh
APP_HOME=.
PID_FILE=$APP_HOME/.pid
MAIN_CLASS="com.inspur.signaling.Daemon"
cmd=`ps aux|grep $MAIN_CLASS|grep -v grep|wc -l`
if [ $cmd -eq 0 ];then
echo "Signaling Daemon not startup!"
exit
@lengyf
lengyf / java_daemon_start.sh
Last active December 16, 2015 03:48
Shell for how to start a Java daemon
#!/bin/sh
APP_HOME=.
PID_FILE=$APP_HOME/.pid
LOG_ROOT=$APP_HOME
#LOG_ROOT=/data/proclog
LOG_HOME=$LOG_ROOT/logs
MAIN_CLASS="com.inspur.signaling.Daemon"
ARGS="-server -Xmx1024m -Xms1024m -XX:+UseParallelGC"
@lengyf
lengyf / ant_build.xml
Last active December 16, 2015 01:20
Configuration for Java Ant
<?xml version="1.0" encoding="utf-8" ?>
<project default="dist" basedir=".">
<!--主要的系统环境属性-->
<property environment="env" />
<!--取window,unix等的环境变量-->
<property name="java.home" value="${env.JAVA_HOME}" />
<property name="ant.home" value="${env.ANT_HOME}" />
<!--主要的app环境属性-->
<property name="app.name" value="refreshd" />
@lengyf
lengyf / decorators.py
Created November 11, 2014 10:04
Some useful decorators.
# -*- coding:utf8 -*-
import warnings
import functools
warnings.simplefilter('default')
def deprecated(replacement=None):
"""This is a decorator which can be used to mark functions
@lengyf
lengyf / nginx_fastcgi_php.conf
Created September 28, 2014 08:48
FastCGI configuration for Nginx php.
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param REQUEST_URI $request_uri;
@lengyf
lengyf / nginx_blog_server.conf
Last active August 29, 2015 14:06
Blog configuration for Nginx server.
server {
listen 80;
server_name blog.sousth.com;
root /var/www/blog;
location / {
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
/*
* Copyright (C) 2007 The Android Open Source Project
*
* 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
@lengyf
lengyf / nginx_server_sample.conf
Last active August 29, 2015 14:06
Sample of Nginx server configuration.
# Sample
server {
listen 80;
server_name www.sample.com;
root /web/www.sample.com;
location / {
# host and port to fastcgi server
fastcgi_pass 127.0.0.1:8000;
include fastcgi.conf;
}