This file contains hidden or 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
| #!/usr/bin/php | |
| <?php | |
| //author:saeed | |
| $api = 'http://dict.youdao.com/fsearch?q='; | |
| if(count($argv) > 1 && $argv[count($argv)-1] != '-h'){ | |
| $arg = array_shift($argv); | |
| if($arg != 'php'){ | |
| $argv = array_slice($argv, 0); |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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` |
This file contains hidden or 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
| sending HTTP requests[https://github.com/jakubroztocil/httpie] | |
| php syntaxCheck [my gist] |
This file contains hidden or 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 | |
| $e = new ReflectionExtension('gearman'); | |
| print "<?php\n\n// Gearman Version: " . $e->getVersion() . "\n\n"; | |
| foreach ($e->getClasses() as $c) { | |
| print 'class ' . $c->name . " {\n"; | |
| foreach ($c->getMethods() as $m) { | |
| print ' '; | |
| if ($m->isPublic()) { | |
| print 'public'; | |
| } elseif ($m->isProtected()) { |
This file contains hidden or 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 | |
| $pid = pcntl_fork(); | |
| if ($pid == -1) { | |
| die('could not fork'); | |
| } else if ($pid) { | |
| pcntl_waitpid($pid, $status, WUNTRACED); //Protect against Zombie children | |
| if (pcntl_wifexited($status)) { | |
| echo "Child exited normally"; | |
| } else if (pcntl_wifstopped($status)) { | |
| echo "Signal: ", pcntl_wstopsig($status), " caused this child to stop."; |
This file contains hidden or 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 | |
| $msg_key = 0x3000111; //系统消息队列的key | |
| $worker_num = 2; //启动的Worker进程数量 | |
| $worker_pid = array(); | |
| $queue = msg_get_queue($msg_key, 0666); | |
| if($queue === false) | |
| { | |
| die("create queue fail\n"); | |
| } |
This file contains hidden or 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
| 1.Vundle.vim | |
| 2.ctrl+p(git) | |
| 3.ctags(set tags+=./../tags,./../../tags,./../../../tags | |
| 4.tlist | |