ITeye博客

2013 年文章归档

共 24 篇文章

UNIX时间戳与ISO-8601时间格式之间的转换

strtotime('2010-03-24 08:15:42'); date('Y-m-d H:i:s', 1156219870); select FROM_UNIXTIME(1156219870); select UNIX_TIMESTAMP('2013-01-10 12:33:00');

2013-12-18 23:58 · PHP · Database

eclipse 忽略jquery压缩文件报错

Project -> Properties -> JavaScript -> Include Path -> Source,编辑Exclusion patterns:加入指定的文件

2013-11-26 19:53 · Javascript

Perl进阶笔记

my @book = ( "Seek Away", "For True" ); my %info = ( "name" => "jason", "age" => 22 ); my %guy = ( "book" => \@book, "info" => \%info ); #更简洁的写法 my %guy = ( "book" => [ "Seek Away", "For True" ], "info" => { "name" => "jason", "age" => 22 } );

2013-11-10 00:43 · Perl

nginx启动SSL默认不输入密码

如果nginx配置了SSL,在每次启动nginx的时候都会需要你手动输入证书的密码,如果不想输入,可以 cp server.key server.key.orig openssl rsa -in server.key.orig -out server.key 这样启动nginx的时候就不需要输入密码了。 当然也可以保留密码,改用expect的方式,这个可以参考expect自动登录SSH的方法,下次有时间再整理贴上来

2013-10-30 14:27 · nginx

nginx + php-fpm 服务器配置

增加.htm格式的文件解析为php 修改nginx.conf,在server{}内,添加 location ~ \.php|\.htm$ { root /home/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 修改/etc/php-fpm.d/www.conf security.limit_extensions = .php .php3 .…

2013-10-30 14:23 · nginx

各种电影视频格式标题的含义

1.CAM(枪版)——珍爱生命,远离枪版 CAM 通常是用数码摄像机从电影院盗录。有时会使用小三角架,但大多数时候不可能使用,所以摄像机会抖动。因此我们看到画面通常偏暗人物常常会失真,下方的字幕时常会出现倾斜。 由于声音是从摄像机自带的话筒录制,所以经常会录到观众的笑声等声音。因为这些因素,图象和声音质量通常都很差。 2.TS——只比枪版好一点 TS 与CAM版的标准是相同的。但它使用的是外置音源(一般是影院座椅上为听力不好的人设的耳机孔)这个音源不能保证是好的音源,因为受到很多背景噪音的干扰。TS是在空的影院或是用专业摄像机在投影室录制,所以图象质量可能比CAM好。但画面的起伏很大。常出现…

2013-10-21 22:24 · 杂记

PHP获得用户的真实IP地址

/** * 获得用户的真实IP地址 * * @access public * @return string */ function real_ip() { static $realip = NULL; if ($realip !== NULL) { return $realip; } if (isset($_SERVER)) { if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']); /* 取X-Forwarded-For中第一个非unknown…

2013-09-28 21:50 · PHP

前端跨域通信各方法总结

原文:http://zciii.com/blogwp/crossdomain/

2013-08-31 00:57 · Web前端

时间转换

/* * Unix timestamp -> 普通时间 */ gmdate('Y-m-d H:i:s', 1377494514);

2013-08-26 13:24 · Javascript · PHP

不知有没有人觉得Intellij IDEA ULTIMATE 12 特别容易崩溃

不知有没有人觉得Intellij IDEA ULTIMATE 12 特别容易崩溃

2013-08-24 18:46 · 杂记

jQuery.proxy可以往函数里传参

for (j = td_counter; j < rows; j++) { td = document.createElement("td"); td.innerHTML = '&nbsp;'; td.onclick = $.proxy(this.onclick, this, i); tr.appendChild(td); }

2013-08-06 10:33 · Javascript

扩展prototype.js Object.deepExtend深度扩展

Object.deepExtend = function(destination, source) { for (var property in source) { if (source[property] && source[property].constructor && source[property].constructor === Object) { destination[property] = destination[property] || {}; arguments.callee(destination[property], source[property]); } els…

2013-07-29 23:08 · Javascript

prototype.js1.7.1在IE下getOffsetParent()会返回body

prototype1.7.1在IE下getOffsetParent()会返回body 可用ancestors()[0]

2013-07-29 20:32 · Javascript

Javascript string repeat 重复拼写字符串

function repeat(s, n){ var a = []; while(a.length < n){ a.push(s); } return a.join(''); } //或者 String.prototype.repeat = function( num ) { return new Array( num + 1 ).join( this ); }

2013-07-17 17:31 · Javascript

Intellij IDEA不能创建和显示rcS文件

1. File -> Settings 2. Select “File Types" 3. In the bottom of the window there is a field called “Ignore files and folders" that contains “rcs". 4. Remove the rcs part from the above field and click “OK".

2013-07-15 10:00 · 编辑器

PowerDesigner怎样才能在修改表的字段Name的时候Code不自动跟着变

http://blog.csdn.net/hongqishi/article/details/7050255

2013-05-07 10:01 · Database

搭建JW Player编译环境

环境 Centos6.3 首先从svn中获取源码,以6.3版本为例 svn co http://developer.longtailvideo.com/svn/tags/mediaplayer-6.3 按照README中的说明,安装 Flex SDK和Ant * Flex SDK 4.1: http://sourceforge.net/adobe/flexsdk/wiki/Downloads/ * Ant 1.7.0: http://ant.apache.org/bindownload.cgi 两个都只需要解压即可 配置Ant环境 export ANT_HOME=/opt/ant/apach…

2013-04-18 14:53 · 其他

Javascript 判断本地文件是否存在

function fileExists(url) { var http = new XMLHttpRequest(); http.open('HEAD', url, false); http.send(); return http.status!=404; }

2013-04-15 14:42 · Javascript

可以参考的javascript编码风格

https://github.com/aralejs/aralejs.org/wiki/JavaScript-%E7%BC%96%E7%A0%81%E9%A3%8E%E6%A0%BC

2013-03-22 23:04 · Javascript

VIM 设置tab为4空格

set tabstop=4 set shiftwidth=4 set expandtab

2013-03-22 23:02 · 编辑器