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
[General] | |
Name=bing | |
;【渲染核心】 | |
;(注意是载入方法,不是渲染方法) | |
;0:用FreeType载入字体 |
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 | |
// 一致性哈希算法 | |
class ConsistentHashing | |
{ | |
protected $nodes = array(); //真实节点 | |
protected $position = array(); //虚拟节点 | |
protected $mul = 64; // 每个节点对应64个虚拟节点 | |
/** |
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/sh | |
# create self-signed server certificate: | |
read -p "Enter your domain [www.example.com]: " DOMAIN | |
echo "Create server key..." | |
openssl genrsa -des3 -out $DOMAIN.key 1024 |
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 | |
/** | |
* Flexihash - A simple consistent hashing implementation for PHP. | |
* | |
* The MIT License | |
* | |
* Copyright (c) 2008 Paul Annesley | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal |
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 | |
define('XDEBUG', "xdebug"); | |
define('ZEND_DEBUGGER', "Zend Debugger"); | |
function createXmlHeader() | |
{ | |
return "<?xml version=\"1.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
$db = function ($request, Closure $next) { | |
echo '成功建立数据库连接' . PHP_EOL; | |
$response = $next($request); | |
echo '成功关闭数据库连接' . PHP_EOL; | |
return $response; | |
}; | |
$like = function ($request, Closure $next) { | |
echo '点赞+1' . PHP_EOL; |
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
function insert_batch($table, $data) | |
{ | |
global $ms_import; | |
$keys = array_keys(current($data)); | |
$values = []; | |
foreach ($data as $clean) { | |
foreach ($clean as $kk=>$vv) { | |
$clean[$kk] = '\'' . addslashes($vv) . '\''; |
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
FROM php:7.1-fpm | |
ENV LIBEVENT_VERSION=2.0.22 | |
RUN apt-get -y update && \ | |
apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev \ | |
libpng12-dev libmemcached-dev libmysqlclient-dev libicu-dev libcurl4-nss-dev \ | |
libzmq-dev libpq-dev libyaml-dev zlib1g-dev \ | |
curl git wget netcat && \ | |
rm -rf /var/lib/apt/lists/* |