- 浏览: 1099881 次
- 性别:
- 来自: 广州
-
最新评论
-
July01:
推荐用StratoIO打印控件,支持网页、URL、图片、PD、 ...
如何解决非IE浏览器的web打印 -
flashbehappy:
同一个视频,有mp4,ogg两种格式的。在chrome,fir ...
firefox chrom safari 对video标签的区别 -
xmdxzyf:
可以在网站(www.sosoapi.com)上试下在线表单方式 ...
用swagger-php/ui做API测试 -
flex_莫冲:
a2631500 写道"看了源码,设置Backbon ...
backbone与php交互 -
a2631500:
"看了源码,设置Backbone.emulateJS ...
backbone与php交互
文章列表
cli code
#!/bin/bash
filepath=$(cd "$(dirname "$0")"; pwd)
cd $filepath
#running status:sso.lock,stop status:ssostop.lock
TMPFILE=$filepath/sso.lock
STOPFILE=$filepath/ssostop.lock
runCLI(){
touch $TMPFILE
echo "sso server process started.\n"
log ...
## 创建job queue job队列
var jobs = kue.createQueue();
##创建job
var job = queue.create('email', {
title: 'welcome email for tj'
, to: 'tj@learnboost.com'
, template: 'welcome-email'
}).save( function(err){
if( !err ) console.log( job.id );
});
##设置job优先级
queue.cre ...
参考:
https://cnodejs.org/topic/516b64596d38277306407936
采用uncaughtException,可以捕获到未正式捕获到的异常,但是无法处理。只能记录log。
process.on('uncaughtException', function (err) {
logger.error(err);
});
于是有了domain。捕获异步回调中出现的异常。
https://nodejs.org/api/domain.html
# String
##set get
set mykey "abc"
get mykey
set counter 100
##incr counter
return 101
##incrby counter 10
return 111
##expire 設置超時時間
設置超時時間10秒。10秒後會被自動刪除
EXPIRE mykey 10
##EXPIREAT
與EXPIRE 類似,不同的是EXPIREAT用的是 UNIX 时间戳 Unix timestamp 。
##PERSIST 移除key的生存時間
PERSIST mykey
## exists
判 ...
参考:http://www.cnblogs.com/ylan2009/archive/2012/02/25/2368028.html
ln 命令的学习
http://blog.csdn.net/conowen/article/details/7251128
什么是vhost?
Vhost是apache服务的虚拟主机,通过配置不同的vhost,可以在同一台apache主机上运行不同的web应用。
如 ...
参考
http://yaf.laruence.com/manual/yaf.install.html
yaf下载:
https://pecl.php.net/package/yaf
版本选择
2.3.5以下版本适用于php5.2 ~ 5.x 的环境
3.0 以上版本适用于php7及以上环境
首先要找到php的安装目录,执行info.php,查看php路径
Configuration File (php.ini) Path /etc/php5/apache2
再查找phpize的地址在哪里,
whereis phpize
然后cd 到yaf的解压缩目录,执行
...
今天終於將prediction.io裝上VM了。遇到好多問題。
參考:
https://docs.prediction.io/install/
https://docs.prediction.io/install/install-linux/(ubuntu獨立安裝看這裡,推薦)
https://docs.prediction.io/start/download/
如果DB用的不是hbase。如mysql,就不需要安裝Elasticsearch
pio/conf/pio-env.sh 要將DATABASE的設置改成mysql。
最後用pio status 檢查是否安裝成功。
pio命令要 ...
安裝redis的時候需要make工具。ubuntu下沒有。需要參考以下安裝
$ sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
$ sudo apt-get update
Then, installing Ubuntu Make:
$ sudo apt-get install ubuntu-make
來源:
https://wiki.ubuntu.com/ubuntu-make
之後在redis目錄執行make
還是失敗了。因為沒有安裝cc,繼續安裝:
sudo apt-get install gcc
...
<了不起的NODEJS>学习笔记
- 博客分类:
- node.js
一、 Chapter1
package.json
{
"names":"my-colors-project",
"version":"0.0.1",
"main":"./index".
"dependencies":{
"colors":"0.5.0"
}
}
如果不想暴露API,在package.json加入"private":true.
察看package.json所有的属性
n ...
参考资料
http://www.cnblogs.com/xiaoit/p/3867573.html
mysql 的order by 查詢默認是會將null排到有值的數據前面的。若想將null放最後面。則需要加上個null的order 控制
例如
SELECT userid, `migrate_time`
FROM member
WHERE STATUS =0
AND id =3
ORDER BY (
update_time IS NULL
), update_time ASC
LIMIT 0 , 30
SELECT * FROM your_table ORDER BY (date_column IS NULL), date_column ASC
參考:http:/ ...
為了讓URL支持中文,例如www.xxx.com/廣州/xx 需要在emptyAction中處理捕獲到的廣州/xxxx。但是TP默認的module名稱是不支持中文的。因此需要修改TP框架的PHP核心文件:
App.class.php
修改後的代碼:
/**
* 执行应用程序
* @access public
* @return void
*/
static public function exec() {
if(!preg_match('/^[A-Za-z](\w)*$/',MODULE_NAME) ){ // 安全 ...
在php中常见的计算字符串长度的函数有:strlen和mb_strlen.当字符全是英文字符的时候,两者是一样。这里主要比较一下,中英文混排的时候,两个计算结果。
AD:干货来了,不要等!WOT2015 北京站演讲PPT开放下载!
在PHP中,strlen与mb ...
linux shell 發送email的命令
body:"This is test mail"
title/subject:'Test mail'
-f admin@qq.com 发件人地址
-F qq 发件人姓名
-t:收件人地址 空格分開可發多個
收件人:to@example.com to2@163.com
echo "This is test mail" | mail -s 'Test mail' to@example.com to2@163.com
echo "This is test mail" | mail -s ' ...
参考资料:
http://www.ssdn2007.com/wordpress-add-quicktags-button-in-function-php.html
http://codex.wordpress.org.cn/Quicktags_API
http://yusi123.com/460.html
functions.php 代码
<?php
// 给editor添加更多默认按纽
function enable_more_buttons($buttons) {
$buttons[] = 'hr';
$buttons[] = 'fontselect';
$ ...