Skip to content

Instantly share code, notes, and snippets.

View GeekGhc's full-sized avatar
👨‍💻
Coding

GeekGhc GeekGhc

👨‍💻
Coding
View GitHub Profile
upstream swoole {
# By IP:Port, php7 is the name of php7 container
server 127.0.0.1:5200 weight=5 max_fails=3 fail_timeout=30s;
# By UnixSocket Stream file
#server unix:/docker/www/laravel-s-test/storage/laravels.sock weight=5 max_fails=3 fail_timeout=30s;
#server php7:5201 weight=3 max_fails=3 fail_timeout=30s;
#server php7:5202 backup;
keepalive 16;
}
server {
<?php
define('ADMIN_USERNAME','admin'); // Admin Username
define('ADMIN_PASSWORD','ghc1996'); // Admin Password
if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']) ||
$_SERVER['PHP_AUTH_USER'] != ADMIN_USERNAME ||$_SERVER['PHP_AUTH_PW'] != ADMIN_PASSWORD) {
Header("WWW-Authenticate: Basic realm=\"Memcache Login\"");
Header("HTTP/1.0 401 Unauthorized");
echo <<<EOB
<html><body>
<?php
//获得几个参数
$token = 'codespace';//此处填写之前开发者配置的token
$nonce = $_GET['nonce'];
$timestamp = $_GET['timestamp'];
$echostr = $_GET['echostr'];
$signature = $_GET['signature'];
// //参数字典序排序
数据库:
初始应户名:homestead
初始密码:secret
ssh/sftp
初始用户名:vagrant
初始密码:vagrant
<?php
error_reporting(1);
$target = '/data/www/ISpace'; // 生产环境web目录
$token = 'ispace'; //GitLab 添加的token
$wwwUser = 'root';
$wwwGroup = 'root';
<?php
namespace app\Repositories;
class Emotion
{
//表情替换 \[[\w-\d]+\]
function replace_emotion($content)
{
@GeekGhc
GeekGhc / QEditor.vue
Created March 14, 2017 06:40
Quill-Editor component file
<template>
<div id="qeditor">
<quill-editor ref="myTextEditor"
:config="editorOption"
@change="onEditorChange($event)">
</quill-editor>
</div>
</template>
<script>
@GeekGhc
GeekGhc / nginx.conf
Created March 6, 2017 09:32
config for nginx
server {
listen 80;
server_name kobeman.com www.kobeman.com;
return 301 https://kobeman.com$request_uri;
root /var/www/ISpace/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
@GeekGhc
GeekGhc / register.vue
Created March 6, 2017 07:39
concrete validations
export default{
data(){
return{
newUser: {
name:'',
email:'',
password:'',
confirm_pwd:''
},
}
@GeekGhc
GeekGhc / register.vue
Last active March 6, 2017 07:37
vuelidate for vueJs
<div class="login-header">
<div class="login-register">
<router-link :to="{name: 'login'}">登录</router-link>
<router-link :to="{ name: 'register'}" class="active">注册</router-link>
</div>
</div>
<div class="login-form">
<div class="control-group" v-bind:class="{ 'form-group--error': $v.newUser.name.$error }">
<label class="control-label">用户名</label>
<el-input