Skip to content

Instantly share code, notes, and snippets.

<trim prefix=" and (" prefixOverrides="or " suffix=")">
<choose>
<when test="groupId != null">
or group_id = #{groupId}
</when>
<when test="groupIdList != null and groupIdList.size() > 0 ">
or group_id in
<foreach collection="groupIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
@leohdr
leohdr / adaptUILayout.js
Created July 26, 2016 03:10 — forked from ijse/adaptUILayout.js
adaptUILayout
/*
* 使用说明:
* 本程序以完成固定宽度布局的网页在iPhone/Android设备上浏览时可以适配设备屏幕宽度(竖屏浏览, 暂未支持横屏浏览)
* 为目的。正常运行的环境是: iPhone/Android设备的自带浏览器.
* 如有问题,意见或建议,请到我的博客页面留言,或发送邮件.
* 其他移动版浏览器的适配问题, 不在本程序处理范围, 若有相关问题, 请留言或发送邮件.
*
* 博客页面地址:
* http://www.cnblogs.com/plums/archive/2013/01/10/WebApp-fixed-width-layout-of-multi-terminal-adapter-since.html
* 邮箱: limuchen12@126.com
@leohdr
leohdr / mdb2sql.sh
Created April 23, 2016 10:17 — forked from turicas/mdb2sql.sh
Convert a MDB (Access) file to SQL
#!/bin/bash
# Convert a MDB file (Access) to SQL
# Needs mdbtools[http://mdbtools.sourceforge.net/]
# run 'aptitude install mdbtools' on Debian/Ubuntu
# Created by Álvaro Justen <https://github.com/turicas>
# License: GPLv2
mdb=$1
sql=$2
@leohdr
leohdr / php_mdb.rst
Created April 23, 2016 10:15 — forked from amirkdv/php_mdb.rst
How to handle MS Access MDB files in Linux with PHP5 PDO and ODBC

To be able to use PHP5 PDO with MS Access mdb files the following is required (the same applies for the PHP4 style of using odbc_X except for the obviously PDO specific requirements):

PHP ODBC module

In Linux this is achieved by intalling the php5-odbc package:

@leohdr
leohdr / wechat_custom_menu.py
Created March 27, 2016 10:00 — forked from kitelife/wechat_custom_menu.py
简单封装了微信服务号自定义菜单API
#coding: utf-8
import requests
import os
import json
import time
class WechatAdmin:
def __init__(self):
@leohdr
leohdr / ntfs_mount.py
Last active August 29, 2015 14:26 — forked from selfboot/ntfs_mount.py
mac os x:自动挂载ntfs硬盘为读写权限。 只要ntfs硬盘连接到电脑即可使用 ./ntfs_mount_auto.py 挂载ntfs磁盘为可读写,ntfs_unmount.py 为卸载磁盘。 ntfs_mount.py 是较早的版本,只有电脑先识别除硬盘,在/Volumes 可读到硬盘内容时才可以使用此脚本挂载为可读写。 建议使用./ntfs_mount_auto.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import re
ntfs_pattern = re.compile(r'File System Personality: NTFS')
ntfs_device_node = re.compile(r'.*Device Node:.*')
device_dict = {}
PHP_VER="5.5.14"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
# Download PHP source and extract
PHP_VER="5.4.17"
# Check if extension exists first
php -m | grep pgsql
# Update brew and install requirements
brew update
brew install autoconf
# Download PHP source and extract
@leohdr
leohdr / sysctl.conf
Last active August 29, 2015 14:21 — forked from vdel26/sysctl.conf
# "Performance Scalability of a Multi-Core Web Server", Nov 2007
# Bryan Veal and Annie Foong, Intel Corporation, Page 4/10
fs.file-max = 5000000
net.core.netdev_max_backlog = 4096
net.core.optmem_max = 10000000
net.core.rmem_default = 10000000
net.core.rmem_max = 10000000
net.core.somaxconn = 4096
net.core.wmem_default = 10000000
net.core.wmem_max = 10000000
@leohdr
leohdr / nginx
Last active August 29, 2015 14:21 — forked from vdel26/nginx
#!/bin/sh
#
# chkconfig: 2345 55 25
# Description: Nginx init.d script, put in /etc/init.d, chmod +x /etc/init.d/nginx
# For Debian, run: update-rc.d -f nginx defaults
# For CentOS, run: chkconfig --add nginx
#
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all