11 2014 档案

页面: Fork me on GitHub
摘要:一、实现效果如下:二、代码地址:https://github.com/blog/273-github-ribbons 这是一个国外网友开发的代码, 里面有很多种样式,可以自已随心选择。三、我们只拿其中一个来举例(如上图): 代码如下: 主要修改下面这段代码: 把 href= 修改为自己的 ... 阅读全文

posted @ 2014-11-21 16:01 chenzc 阅读(1726) 评论(1) 推荐(3)

expect ssh 自动登录 example
摘要:#!/usr/bin/expect -fset ip [lindex $argv 0]set port [lindex $argv 1]set username [lindex $argv 2]set password [lindex $argv 3]set timeout 10spawn ssh ... 阅读全文

posted @ 2014-11-21 11:52 chenzc 阅读(214) 评论(0) 推荐(0)

laravel4 「时间戳」问题
摘要:默认 Eloquent 会自动维护数据库表的 created_at 和 updated_at 字段。只要把这两个「时间戳」字段加到数据库表, Eloquent 就会处理剩下的工作。如果不想让 Eloquent 自动维护这些字段,把下面的属性加到模型类里:关闭自动更新时间戳class User ext... 阅读全文

posted @ 2014-11-09 20:56 chenzc 阅读(317) 评论(0) 推荐(0)

laravel运行慢是怎么回事?
摘要:因为默认的 hello 页面引用了 google 的字体,至于为什么 google 这么慢就不用我详细说明了吧。 阅读全文

posted @ 2014-11-08 23:17 chenzc 阅读(486) 评论(0) 推荐(0)

Laravel4快速安装方法,解决Laravel4安装速度慢
摘要:Laravel4原始安装方法Laravel4 是构建在 Composer 之上的, 之前的安装方法是如下:composer create-project laravel/laravel your-project-name --prefer-dist1composer create-project l... 阅读全文

posted @ 2014-11-07 22:58 chenzc 阅读(1252) 评论(0) 推荐(0)

nginx支持.htaccess文件实现伪静态的方法
摘要:方法如下:1. 在需要使用.htaccess文件的目录下新建一个.htaccess文件,vim /var/www/html/.htaccess2. 在里面输入规则,我这里输入Discuz的伪静态规则:# nginx rewrite rulerewrite /!.(js|gif|jpg|png|css... 阅读全文

posted @ 2014-11-07 11:16 chenzc 阅读(812) 评论(0) 推荐(0)

PHP smarty
摘要:assign('name','zhang');//调用模板tpl文件里不能执行PHP语句块$smarty->display('templates/index.tpl');/*index.tpl页面内容你好, {$name}*//*Smarty编译时的处理过程是源php文件->模板文件(可能调用多个或... 阅读全文

posted @ 2014-11-06 16:59 chenzc 阅读(201) 评论(0) 推荐(0)

PHP Warning: strftime(): It is not safe to rely on the system's timezone set
摘要:当运行一些程序时,在httpd日志中会有如下警告日志:PHP Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timez... 阅读全文

posted @ 2014-11-06 16:46 chenzc 阅读(3003) 评论(0) 推荐(1)

Jackson 使用
摘要:// 序列化出来的 JSON, 不包含值为 NULL 类型字段。mapper.setSerializationInclusion(Include.NON_NULL); Jackson provides a few different mechanisms to configure handli... 阅读全文

posted @ 2014-11-04 17:14 chenzc 阅读(451) 评论(0) 推荐(0)

导航