Skip to content

Instantly share code, notes, and snippets.

View lvjian700's full-sized avatar

Jian Lyu lvjian700

View GitHub Profile
@lvjian700
lvjian700 / index.html
Created June 4, 2013 11:04
Illegal character validation
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<input type="text" id="taskName" value="" />
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript">
var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]");
@lvjian700
lvjian700 / slshoulu_users.sql
Created May 24, 2013 06:02
大洋收录简易网管sql脚本
------------------------------------------------
---------------------2013.05.23 V3.0.0----------
-----1、主要包括:建库脚本和创建超级用户--------
------------------------------------------------
CREATE TABLE [dbo].[shiro_users](
[user_id] varchar(36) NOT NULL,
[name] varchar(250) NULL,
[dyid] varchar(250) NULL,
#import "DYOBDeviceDesc.h"
@interface DYOBDeviceDesc (Services)
+(void) descOfDeviceId: (NSString *) deviceId success:( void (^) (NSArray *obDeviceDescs) ) success;
@end
@lvjian700
lvjian700 / new_gist_file
Created May 19, 2013 09:36
Improve NSLog for CocoaTouch
#ifdef DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
# define DLog(...)
#endif
// ALog always displays output regardless of the DEBUG setting
#define ALog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
@lvjian700
lvjian700 / build.xml
Created May 19, 2013 09:35
Deploy Java Web Project to FTP
<?xml version="1.0" encoding="utf-8" ?>
<project name="biandan3" default="compile">
<description>The biandan3 project ant script tools</description>
<property environment="env"/>
<property name="basedir" value="." />
<property name="src.java" value="${basedir}/src/java" />
<property name="src.groovy" value="${basedir}/src/groovy" />
<property name="src.res" value="${basedir}/src/resource" />
@lvjian700
lvjian700 / new_gist_file
Created May 19, 2013 09:34
Setting UITableView selected row
NSIndexPath *indexSelected = [NSIndexPath indexPathForRow:index inSection:0];
[self tableView: self.taskTable willSelectRowAtIndexPath:indexSelected];
[self.taskTable selectRowAtIndexPath:indexSelected
animated:YES
scrollPosition:UITableViewScrollPositionMiddle];
[self tableView: self.taskTable didSelectRowAtIndexPath:indexSelected];
@lvjian700
lvjian700 / new_gist_file
Created May 19, 2013 09:33
Custom UITableView & Cell backgroud color
#table
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg_window_landscape.png"]]
#Cell
UIView *backgrdView = [[UIView alloc] initWithFrame:cell.frame];
backgrdView.backgroundColor = [UIColor whiteColor];
cell.backgroundView = backgrdView;
@lvjian700
lvjian700 / build.xml
Created May 19, 2013 09:31
Compile Java Project include jar & doc
<?xml version="1.0" encoding="utf-8" ?>
<project name="uploadfile" default="compile" basedir=".">
<property name="src.dir" value="src/java" />
<property name="test.dir" value="src/test" />
<property name="res.dir" value="src/resources" />
<property name="bin.dir" value="bin" />
<property name="lib.dir" value="libs" />
<property name="doc.dir" value="doc" />
<property name="classes.dir" value="${bin.dir}/classes" />
@lvjian700
lvjian700 / new_gist_file
Created May 14, 2013 06:08
Using command line, Compile & Run Java App .
javac MainClass.java -cp "path/lib/*"
java -cp "path/lib/*" package.MainClass
@lvjian700
lvjian700 / gitconfig.bat
Created May 6, 2013 03:23
Git basic config for Windows
@ECHO OFF
git config --global user.name "lvjian"
git config --global user.email "[email protected]"
echo 配置别名
git config --global alias.co "checkout"
git config --global alias.st "status"
git config --global alias.ci "commit"
echo 配置默认编辑器