Skip to content

Instantly share code, notes, and snippets.

View cyonks's full-sized avatar
🏠
Working from home

cyonks cyonks

🏠
Working from home
View GitHub Profile
@cyonks
cyonks / nginx_config.md
Created January 7, 2016 05:27
nginx配置
upstream swooletest{
  server 127.0.0.1:9501;
  keepalive 4;
}
server{
  listen 80;
  server_name www.server.com;
 root /home/www/cyonks;
@cyonks
cyonks / http_server_swoole.php
Created January 6, 2016 06:32
基于swoole_http_server的Http服务器
<?php
$http = new swoole_http_server("127.0.0.1", 9501);
$http->on('request', function ($request, $response) {
$html = "<h1>Hello Swoole.</h1>";
$response->end($html);
});
$http->start();
@cyonks
cyonks / simple_server_swoole.php
Last active January 7, 2016 04:16
基于swoole_server的简单Http服务器
<?php
//1.构建Server对象
$serv = new swoole_server("0.0.0.0", 9501);
//2.设置运行时参数
$serv->set(array(
'worker_num' => 8,
'daemonize' => 0,
'max_request' => 10000,
@cyonks
cyonks / gist:723ee8c586619b87f785
Created December 31, 2015 10:46 — forked from AliMD/gist:3344523
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@cyonks
cyonks / cur_url.php
Last active January 6, 2016 06:25
PHP获取当前浏览器访问的链接
<?php
/**
* 获取当前浏览器访问的链接
* @return String
*/
function cur_url() {
if (isset($_SERVER['SERVER_PROTOCOL'])) {
$sch = strpos($_SERVER['SERVER_PROTOCOL'], 'https') !== false ? 'https://' : 'http://';
}