Skip to content

Instantly share code, notes, and snippets.

View gmailzj's full-sized avatar

lake gmailzj

View GitHub Profile
@gmailzj
gmailzj / ReadMe.md
Last active September 13, 2023 11:47
interesting product

buildwith.com

loki

@gmailzj
gmailzj / json.php
Created August 25, 2023 11:17
php json
<?php
$arr = [];
$arr[1] = 'yyy';
$arr[0] = 'xxx';
echo json_encode($arr);//{"1":"yyy","0":"xxx"}
$arr = [];
$arr[0] = 'xxx';
@gmailzj
gmailzj / Install-php5.6-on-Centos7.md
Created November 22, 2022 09:23 — forked from ayonliu/Install-php5.6-on-Centos7.md
Install php5.6 on Centos 7
@gmailzj
gmailzj / 00_README.md
Created October 31, 2022 18:02 — forked from YumaInaura/00_README.md
Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

Golang — Understanding channel, buffer, blocking, deadlock and happy groutines.

I was so confused to understand behaviior of Golang channels, buffer, blocking, deadlocking and groutines.

I read Go by Example topics.

@gmailzj
gmailzj / semantic-commit-messages.md
Created October 30, 2022 05:53 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@gmailzj
gmailzj / rgrow.c
Created July 4, 2022 15:54 — forked from lecram/rgrow.c
Region Growing (C)
#include <stdlib.h>
#include <stdio.h>
#include <opencv/cv.h>
#include <opencv/highgui.h>
typedef struct {
unsigned char r;
unsigned char g;
unsigned char b;
@gmailzj
gmailzj / gist:93b70dc94628f1cb8738e39a161a8058
Created August 31, 2020 08:28
传递参数json和querystring
前端向后端传输数据时,如果是get传输,直接传在url后;如果是post传输,则在请求体body中传输。
在body中的数据格式又有两种,一种是 json 数据格式,另一种是 字符串。具体要用哪种格式取决于后端入参的格式。
如果后端接收json数据类型,post 的 headers 需要设置 { ‘content-type’: ’application/json’ },传给后端的数据就形如 { ‘name’:’edward’, ‘age’:’25’ }
package main
import (
"fmt"
"sync"
)
func main() {
list := []int{0, 1, 2, 3, 4}
sizes := make(chan int)
@gmailzj
gmailzj / cgit.md
Last active November 10, 2019 15:55
mac cgit and nginx config

brew install cgit

brew install fcgiwrap

配置nginx

配置 fcgiwrap

配置cgit;文件路径 /usr/local/etc/cgitrc

@gmailzj
gmailzj / utils.php
Created October 16, 2019 02:38
php收集
<?php
/**
* 下划线转驼峰
* 思路:
* step1.原字符串转小写,原字符串中的分隔符用空格替换,在字符串开头加上分隔符
* step2.将字符串中每个单词的首字母转换为大写,再去空格,去字符串首部附加的分隔符.
*/
function camelize($uncamelized_words,$separator='_')
{
$uncamelized_words = $separator. str_replace($separator, " ", strtolower($uncamelized_words));