This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Screen Resolution stuck at 640x480 after installing | |
In /etc/X11/xorg.conf, look for these two lines : | |
HorizSync 28.0 - 33.0 | |
VertRefresh 43.0 - 72.0 | |
and replace them with | |
HorizSync 30.0 - 83.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).click(function(e){ | |
// Check if click was triggered on or within #menu_content | |
if( $(e.target).closest("#menu_content").length > 0 ) { | |
return false; | |
} | |
// Otherwise | |
// trigger your click function | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
消息队列(message queue)也是Linux系统进程间通信的一种方式。 | |
除了现有的一些消息队列解决方案以外,PHP对共享内存段的操作有两组函数:System V IPC和Shared Memory。 其中System V IPC由AT&T的贝尔实验室对早期的UNIX系统贡献而来,现在的linux系统都完美的继承了下来,该系列函数能够更方便的操作数据,无需像Shared Memory那样必须自己掌握读写时的偏移量、长度等,也不用序列化/反序列化来回转换(因为Shared Memory函数只支持字符串格式的数据参数)。但是System V IPC系列不支持Windows,所以如果要在win环境下使用,只能选Shared Memory。 | |
PHP的System V msg模块是对Linux系统支持的System V IPC中的System V消息队列函数族的封装。我们需要利用sysvmsg模块提供的函数来进进程间通信。 | |
<?php | |
$message_queue_key = ftok(__FILE__, 'a'); | |
$message_queue = msg_get_queue($message_queue_key, 0666); | |
var_dump($message_queue); | |
$message_queue_status = msg_stat_queue($message_queue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected function _strip_text($data, $type=false){ | |
if(is_array($data)){ | |
foreach($data as $key=>$val){ | |
$data[$key] = $this->_strip_text($val, $type); | |
} | |
}elseif(is_object($data)){ | |
foreach(get_object_vars($data) as $property => $val) { | |
$data->$property = $this->_strip_text($val, $type); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 一般设定 | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" 设定主题 | |
set t_Co=256 | |
syntax enable | |
set background=dark | |
colorscheme molokai | |
" 设定默认解码 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <curl/curl.h> | |
#define POSTURL "http://127.0.0.1" | |
#define LOGFILE "post.log" | |
#define RESOURCE_KEY "" | |
#define CUSTOM_VALUE "" | |
#define UPLOAD_TOKEN "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 8090; | |
root /var/www/ti; | |
index index.php index.html index.htm; | |
# Enable rewrite error log | |
# error_log /var/log/nginx/localhost.error_log debug; | |
# rewrite_log on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$packages = array(); | |
$contents = file_get_contents('package.txt'); | |
$packages = explode('|', $contents); | |
foreach ($packages as $key=>$package) { | |
if (empty($package)) continue; | |
$packages[$key] = trim($package); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* UUID class | |
* | |
* The following class generates VALID RFC 4122 COMPLIANT | |
* Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
* | |
* UUIDs generated validates using OSSP UUID Tool, and output | |
* for named-based UUIDs are exactly the same. This is a pure | |
* PHP implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
search_dir=$1 | |
i=0 | |
error_files=() | |
if [ ! $search_dir ]; then | |
search_dir='.' | |
fi | |
if [ -f "$search_dir" ];then | |
ck_result=`php -l $search_dir` |
OlderNewer