Skip to content

Instantly share code, notes, and snippets.

View guanhui07's full-sized avatar
:octocat:
Focusing

royee guanhui07

:octocat:
Focusing
View GitHub Profile
@guanhui07
guanhui07 / gist:24d223ac51ec83dde9473961d33082f6
Created July 18, 2019 09:06 — forked from membphis/gist:05064f2edc6fb4081c6af04fac43ba49
benchmark apisix 0.5 with fake apisix server
# ./benchmark/run.sh
+ '[' -n '' ']'
+ worker_cnt=1
+ mkdir -p benchmark/server/logs
+ mkdir -p benchmark/fake-apisix/logs
+ sudo openresty -p /root/apisix/benchmark/server
+ trap onCtrlC INT
+ sed -i 's/worker_processes [0-9]*/worker_processes 1/g' conf/nginx.conf
+ make run
mkdir -p logs
@guanhui07
guanhui07 / aes_enc_dec.php
Created May 22, 2019 02:00 — forked from turret-io/aes_enc_dec.php
AES encryption/decryption in PHP
<?php
// DEFINE our cipher
define('AES_256_CBC', 'aes-256-cbc');
// Generate a 256-bit encryption key
// This should be stored somewhere instead of recreating it each time
$encryption_key = openssl_random_pseudo_bytes(32);
// Generate an initialization vector
// This *MUST* be available for decryption as well
FROM centos:7.3.1611
RUN yum update -y && yum install -y wget make gcc gcc-c++ unzip git patch readline-devel \
bzip2 zlib zlib-devel
ENV BUILD_PATH=/tmp/build
RUN mkdir --verbose -p "$BUILD_PATH"
ENV PCRE_VERSION=8.43
@guanhui07
guanhui07 / emojis.json
Created March 18, 2019 06:47 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
<?php
define('XDEBUG', "xdebug");
define('ZEND_DEBUGGER', "Zend Debugger");
function createXmlHeader()
{
return "<?xml version=\"1.0\"?>";
}
@guanhui07
guanhui07 / sendCloud.php
Created September 16, 2018 07:44 — forked from JellyBool/sendCloud.php
SendCloud Email Version_2
<?php
namespace App\Mailer;
/**
* Class QQMailer
* @package App\Mailer
*/
class Mailer {
<?php
class Node
{
public $name;
public $linked = array();
public function __construct($name)
{
$this->name = $name;
@guanhui07
guanhui07 / nginx.conf
Created October 13, 2016 02:59 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your location block(s):
#
# include cors_support;
#
# A limitation to this method is that Nginx doesn't currently send headers
@guanhui07
guanhui07 / Install_tmux
Created September 30, 2016 14:41 — forked from simme/Install_tmux
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@guanhui07
guanhui07 / makeauthority.sh
Created September 27, 2016 03:42 — forked from richieforeman/makeauthority.sh
Issue Your Own Self-Signed S/MIME Certs with OpenSSL
# Run this once
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt