Skip to content

Instantly share code, notes, and snippets.

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

royee guanhui07

:octocat:
Focusing
View GitHub Profile
package levelcache
import (
"errors"
"fmt"
"strings"
"sync"
)
type Node struct {
@guanhui07
guanhui07 / gist:48094946ebf0191c1161159c56cdc193
Created October 15, 2019 06:27
ruby_fakeaddressgenerator
require 'curb'
require 'json'
require 'pry'
TOKEN = 'AIzaSyBH8rt__HdxDXldlreAzCL6ZxsyRk0mJXk'
class PlaceSearch
attr_accessor :token
package main
import (
"os"
"os/signal"
"syscall"
"fmt"
)
func main() {
" ====================== vim 配色设置 =====================
set encoding=utf-8
syntax enable
set background=dark
colorscheme solarized
" 设置字体
set guifont=Monaco:h14
" solarized主题设置在终端下的设置
let g:solarized_termcolors=256
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void getSubStr(char *str,char *substr,int start,int end);
void getStr(char *str,char *substr,int start,int end);
int startposizition(char *str,int start);
int endposizition(char *str,int end);
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
pid_t pid;
char *message;
@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