上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 28 下一页
摘要: 情景:域名A:http://www.sharefamily.net域名B:http://member.sharefamily.net域名A要通过ajax,调用域名B的数据,这样就会出现ajax跨域名请求的问题。如果你是使用了jQuery,那么就很好处理了,将ajax的dataType设置为jsonp就可以了。域名A的js代码原来是: jQuery.ajax({ url: 'http://member.sharefamily.net', type: 'get', dataType: 'json', success: function (rs) { 阅读全文
posted @ 2013-04-17 15:23 DavidHHuan 阅读(1102) 评论(0) 推荐(0) 编辑
摘要: SEO是一个网站推广的重中之重,也是判断一个网站是否成功的关键所在。除了一些常规的写软文,发外链这些表面功夫,你是否有注意到,修炼自己网站的内功才是首要呢?废话不说,我们就以百度、admin5.com为参考,说一下如何修炼自己网站的内功。网站title打开百度的首页,http://www.baidu.com,可以看到她的标题是“百度一下,你就知道”,很简单,不超过80个字符,包含了关键字,百度,网站标题包含着自己站点名称这个是很重要的。再继续往下看,去到百度知道,http://zhidao.baidu.com,作为百度的一个子站,它的标题是“百度知道- 全球最大中文互动问答平台”,看到没,它的 阅读全文
posted @ 2013-04-10 14:57 DavidHHuan 阅读(2411) 评论(0) 推荐(0) 编辑
摘要: struct结构如下:package modelsimport ( "github.com/robfig/revel")type Post struct { id int title string}我在另一个包里面使用package controllersimport ( "blog/app/models" "fmt" "github.com/coopernurse/gorp" "github.com/robfig/revel")type Application struct { *revel. 阅读全文
posted @ 2013-04-09 18:29 DavidHHuan 阅读(5534) 评论(0) 推荐(0) 编辑
摘要: 1. 先到微信公众平台注册帐号http://mp.weixin.qq.com2. 下载demo微信公众平台提供了一个十分“朴素”的demo,说明如何调用消息接口的。代码真的很朴素,具体内容可到官网下载。3. 按照Yii的规则,做一个extension。这里命名为 weixin,目录结构如下:▾ extensions/ ▾ weixin/ Weixin.php*Weixin.php代码内容:<?php/** * WeixinCallback * * @package * @version $id$ * @copyright 1997-2005 The PHP Group * @... 阅读全文
posted @ 2013-04-02 21:26 DavidHHuan 阅读(5245) 评论(1) 推荐(0) 编辑
摘要: 使用了bootstrap的modal用来加载远程内容<a class="btn it-dt-btn" data-toggle="modal" data-target="#it-de-md" data-cache="false" href="/sf/admin/item/itemDetail/cid/18690263400.html">Detail</a>但是 href 是动态变化的,也就是说,一个页面,使用了同一个modal来根据href加载不同内容,但是很遗憾的是 bo 阅读全文
posted @ 2013-02-06 17:00 DavidHHuan 阅读(13181) 评论(0) 推荐(0) 编辑
摘要: php版本davidhhuan@davidhhuan-ThinkPad-T410:~$ php -versionPHP 5.3.10-1ubuntu3.4 with Suhosin-Patch (cli) (built: Sep 12 2012 18:59:41) Copyright (c) 1997-2012 The PHP GroupZend Engine v2.3.0, Copyright (c) 1998-2012 Zend TechnologiesYii版本1.1.13Yii Framework使用spl_autoload_register实现类的自动加载,这个很大的方便我们不用每次 阅读全文
posted @ 2013-02-06 01:02 DavidHHuan 阅读(14133) 评论(0) 推荐(1) 编辑
摘要: 原文地址:http://www.qttc.net/201206105.htmlfunction urlShort($url){ $url= crc32($url); $result= sprintf("%u", $url); $sUrl= ''; while($result>0){ $s= $result%62; if($s>35){ $s= chr($s+61); } elseif($s>9 && $s<=35){ $s= chr($s+ 55); } $... 阅读全文
posted @ 2013-01-29 15:03 DavidHHuan 阅读(17898) 评论(0) 推荐(0) 编辑
摘要: 1. Download the phpmanual_for_vimhttp://pan.baidu.com/share/link?shareid=256523&uk=28021265722. Uncompress the file to a directory, for example, ~/.vim/doc/phpmanual3. set the configure of .vimrcset runtimepath+=~/.vim/doc/phpmanualautocmd BufNewFile,Bufread *.ros,*.inc,*.php set keywordprg=&quo 阅读全文
posted @ 2013-01-13 01:22 DavidHHuan 阅读(18798) 评论(0) 推荐(0) 编辑
摘要: I found a good plugin for vim, that isYii API manual for Vim, which you can checkthe api in vim!here is the website:https://github.com/vim-scripts/Yii-API-manual-for-VimBut that, why i write this article is that, when iCreatting custom version follows:git clone https://github.com/yiisoft/yii.git /me 阅读全文
posted @ 2013-01-12 03:08 DavidHHuan 阅读(17523) 评论(0) 推荐(0) 编辑
摘要: CentOS的cronjob日志是放在/var/log/cron那么ubuntu的cronjob默认是不开启日志功能的,要先开启它sudo vim /etc/rsyslog.d/50-default.conf ### 将文件中的 cron.* 前面的 # 去掉sudo service rsyslog restart ### 重启rsyslog服务service cron restart ### 重启cron服务现在就可以通过查看 /var/log/cron.log 查看cronjob的日志了。 阅读全文
posted @ 2013-01-11 14:18 DavidHHuan 阅读(12838) 评论(0) 推荐(0) 编辑
摘要: 平时都有用着vim,安装的都是自己下载然后解压装到vim里面的。刚才无意中看到一篇文章,说用Vundle可以管理vim的插件,于是试了一下,感觉很爽!原文地址:http://williamherry.com/blog/2012/07/16/master-vim-01-vundle/Vundle利用g... 阅读全文
posted @ 2013-01-06 01:19 DavidHHuan 阅读(17463) 评论(0) 推荐(0) 编辑
摘要: when i using$command = Yii::app()->db->createCommand(" SELECT * FROM vote v LEFT JOIN works w ON w.id = v.works_id LEFT JOIN activity a ON a.id = w.activ... 阅读全文
posted @ 2012-12-28 15:36 DavidHHuan 阅读(13239) 评论(0) 推荐(0) 编辑
摘要: 1. install vsftpd, the version here is2.3.5sudo apt-get install vsftpd2. create a user as a ftp accountsudo mkdir /var/www/ftpuseradd –s /sbin/nologin –d /var/www/ftp ftpuserpasswd ftpusersudo chown –R ftpuser:ftpuser /var/www/ftp3. modify the setting of vsftpdlocal_enable=YESwrite_enable=YESchroot_ 阅读全文
posted @ 2012-12-27 00:27 DavidHHuan 阅读(12525) 评论(0) 推荐(0) 编辑
摘要: 1. 安装 redis serversudo apt-get install aptitudesudo aptitude install redis-server2. 安装phpredis 扩展sudo apt-get install php5-devgit clone git://github.com/nicolasff/phpredis.git phprediscd phpredisphpize./configuremakesudo -s make install3. 在 php.ini 设置 redis 路径[redis]extension=/usr/lib/php5/20100525/ 阅读全文
posted @ 2012-12-10 17:28 DavidHHuan 阅读(12372) 评论(0) 推荐(0) 编辑
摘要: As we know, in Ubuntu12.10, the user interface is Unity, it is really not so conveience to use.For example, when i installed the skype, i found i can NOT see the skype icon in the notification bar in the top of the desktop.After googling for a while, at last i find and success to find it back.In you 阅读全文
posted @ 2012-12-10 14:19 DavidHHuan 阅读(12251) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 28 下一页