lihuai.net
只有20行Javascript代码!手把手教你写一个页面模板引擎 | 李坏博客
http://www.lihuai.net/javascript/2615.html
Raquo; 只有20行Javascript代码 手把手教你写一个页面模板引擎. Tpl, data) {. P Hello, my name is %name% . I 'm %age% years old. /p '. Console.log(TemplateEngine(template, {. Hello, my name is Krasimir. I'm 29 years old. /. Var re = / %([ % ] )? Re = / %([ % ] )? Match = re.exec(tpl);. P Hello, my name is %name% . I 'm %age% years old. /p ". Re = / %([ % ] )? Match = re.exec(tpl) {. Tpl, data) {. Re = / %([ % ] )? Match = re.exec(tpl) {. Tpl = tpl.replace(match[0], data[match[1] ). Profile: { age: 29 }. Console.log(arg 1);".
lihuai.net
Linux系统 | 李坏博客
http://www.lihuai.net/./linux
Php /* * * 备份数据库结构 * * * / /* * 正好要研究如何备份数据库,分享一个php实现MYSQL备份的类库* * * * / /* 函数名称 table2sql() 函数功能 把表的结构转换成为SQL 函数参数 $table:. 1Postfix 安装 1 关闭sendmail 服务 $ /etc/init.d/sendmail stop 2 安装Postfix软件 $ yum install Postfix 2.配置Postfix 启用SMTP认证 $ yum -y install cyrus-sasl* $ /etc/init.d/saslauthd start. 使用方法,在select语句前加上explain就可以了 explain select * from user where name='abcd'; 显示. 1删除列 ALTER TABLE 表名字 DROP 列名称 2.增加列 ALTER TABLE 表名字 ADD 列名称 INT NOT NULL COMMENT ‘注释说明’ 3.修改列的类型信息 ALTER TABL.
lihuai.net
IT 趣闻 | 李坏博客
http://www.lihuai.net/./itlife/interesting
1 色慾 Lust 作为程序员,这种罪恶. 20 That’s weird 很奇怪 19. It’s never done that before. 以前没这样过的。 18 It worked yesterday. 昨天还好好的。 17 How is that possible? 那怎么可能 怎么会出问题 16. It must be a hardware problem. 这一定是硬件问题。 15 What did you type in wrong to get.
lihuai.net
MySQL数据库 | 李坏博客
http://www.lihuai.net/./linux/mysql
Php /* * * 备份数据库结构 * * * / /* * 正好要研究如何备份数据库,分享一个php实现MYSQL备份的类库* * * * / /* 函数名称 table2sql() 函数功能 把表的结构转换成为SQL 函数参数 $table:. 使用方法,在select语句前加上explain就可以了 explain select * from user where name='abcd'; 显示. 1mysqldump的几种常用方法 1 导出整个数据库(包括数据库中的数据 mysqldump -u username -p dbname dbname.sql 2 导出数据库结构 不含数据 mysqldump -u username -p -d dbname dbname.sql 3 导出数据库中的某张数据表 包含数据 mysqldump -u username -p.
lihuai.net
Apache服务器 | 李坏博客
http://www.lihuai.net/./linux/apache
1 禁止访问某些文件/目录 增加Files选项来控制,比如要不允许访问 .inc 扩展名的文件,保护php类库 Files .inc$ Order allow,deny Deny from all /Files 2.禁止访问某些指定的目录 可以用 来进行正则匹配 Directory /var/www/(. /)*. 在研究PHP缓存的时候,安装PHP Apc扩展,发现该扩展是不能用yum方式直接安装的,下面给大家分享一种不用源码安装的简便方法,依次执行下面的命令 1.首先安装相关工具包 yum install php-pear php-devel httpd-devel pcre-devel gcc make &.
lihuai.net
Javascript高级技巧 | 李坏博客
http://www.lihuai.net/javascript/2616.html
使用Object.prototype.toString.call(obj)的方式。 Name = name; }. 然而之后如果不是去 var person = new Person(“cnblogs”)。 而是 var person = Person(“cnblogs”)。 如果不是,则new Person(x,x,x);. Name = name; }. Person(name); } }. 改变函数里面this指向的方法就是 call 和 apply,不过用这两个方法都会执行函数。 I = 0 ; window.onresize. I = 0, j = 1 ; window.onresize. J % 2 = 0 ){ console.log(i. Throttle(method , context){ clearTimeout(method.tId); method.tId. Method.call(context); },. 转载请注明原文地址 http:/ www.lihuai.net/javascript/2616.html.
lihuai.net
编程语言 | 李坏博客
http://www.lihuai.net/./program
实例 – /source/class/table/table forum faq.php – /source/class/model/model forum post.php – /source/plugin/security/table/table security evilpost.php # 引入公共类import($name, $folder = ”, $force = true) 1. 会索引被引入过的类,防止重复引入 2. impor. 首先弄清楚,什么是bom头 在Windows下用记事本之类的程序将文本文件保存为UTF-8格式时,记事本会在文件头前面加上几个不可见的字符 EF BB BF ,就是所谓的BOM Byte order Mark。 不仅限于 记事本保存的文件,只要在文件的开口包含了EF BB BF 几个不可见的字符 十六进制应该是是xEFxBBxBF,用. Php 提示Warning: mysql fetch array() expects. 我的高度代码如下 include(“conn.php”); if(!
lihuai.net
CSS | 李坏博客
http://www.lihuai.net/./qianduan/css
我们都知道 margin:0 auto; 的样式能让元素水平居中,而 margin: auto; 却不能做到垂直居中今天李坏为大家推荐一种方法,让元素绝对居中,只需要声明元素高度,并且附加以下样式,就可以做到 .Absolute-Center { margin: auto; position: absolute.
lihuai.net
WordPress | 李坏博客
http://www.lihuai.net/./wp
从今天开始李坏博客的域名正式由原来的www.itlee.name更换为www.lihuai.net,鉴于更换域名的过程中遇到一些问题,将操作过程分享出来方便大家以后参考。 Wordpress3.0以后增加了新的生成评论表单的方法comment form(),是原来构建评论表单的方法大大简化了 从wordpress3.0以后再也不用写大量的html代码来自定义表单了。 当网站页面过长时,实现侧边栏指定内容 如 广告、推荐内容… 跟随页面滚动即成为一个很实用的效果,下面李坏就借花献佛,为大家介绍一下目前比较流行的jQuery插件sidebar-follow-jquery的具体用法。 1下载sidebar-follow-jquery 点击下载 2.将下载. WordPress侧边栏最新评论列表默认的样式是 评论人 评论文章的标题 ,这样的样式不能让读者方便的阅读评论内容,用户体验并不理想。