This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#step 1 | |
yum -y install python-setuptools | |
#step 2 | |
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm | |
# or | |
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm | |
#step 3 | |
# if you using centOS 6.2 enable rpmforge-extras (enabled =1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
# Created on ${0:iso} | |
# @mail: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//校验日期 | |
function isdate(object) { | |
var s = document.getElementById(object.id).value; | |
var pattern = /^((\d{2}(([02468][048])|([13579][26]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|([1-2][0-9])))))|(\d{2}(([02468][1235679])|([13579][01345789]))[\-\/\s]?((((0?[13578])|(1[02]))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\-\/\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\-\/\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\s(((0?[0-9])|([1-2][0-3]))\:([0-5]?[0-9])((\s)|(\:([0-5]?[0-9])))))?$/; | |
if (s != "") { | |
if (!pattern.exec(s)) { | |
alert('请输入正确的日期'); | |
object.value = ""; | |
object.focus(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isMobile(object) { | |
var s = document.getElementById(object.id).value; | |
var reg0 = /^13\d{5,9}$/; | |
var reg1 = /^153\d{4,8}$/; | |
var reg2 = /^159\d{4,8}$/; | |
var reg3 = /^0\d{10,11}$/; | |
var my = false; | |
if (reg0.test(s)) my = true; | |
if (reg1.test(s)) my = true; | |
if (reg2.test(s)) my = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isPostalCode(object) { | |
//校验(国内)邮政编码 | |
var s = document.getElementById(object.id).value; | |
var pattern = /^[0-9]{6}$/; | |
if (s !== "") { | |
if (!pattern.exec(s)) { | |
alert('请输入正确的邮政编码'); | |
object.value = ""; | |
object.focus(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isEmailAddr(object) { | |
var s = document.getElementById(object.id).value; | |
var pattern = /^[a-zA-Z0-9_\-]{1,}@[a-zA-Z0-9_\-]{1,}\.[a-zA-Z0-9_\-.]{1,}$/; | |
if (s !== "") { | |
if (!pattern.exec(s)) { | |
alert('请输入正确的邮箱地址'); | |
object.value = ""; | |
object.focus(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testisNum(object) { | |
var s = document.getElementById(object.id).value; | |
if (s !== "") { | |
if (isNaN(s)) { | |
alert("请输入数字"); | |
object.value = ""; | |
object.focus(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Filename: | |
define(['jquery', 'underscore', 'backbone', | |
// load module | |
], function($, _, Backbone, ){ | |
return ; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
from datetime import datetime | |
from sys import exit | |
from fabric.api import env, run, local, task, settings, sudo | |
import re | |
env.hosts = ['[email protected]'] | |
environments = { | |
'__base__': { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
OlderNewer