Skip to content

Instantly share code, notes, and snippets.

View WGrape's full-sized avatar
🖥️
24 hours online

WGrape

🖥️
24 hours online
View GitHub Profile
@WGrape
WGrape / combination.go
Last active March 11, 2022 15:49
Go语言实现基于树的组合算法
package abstract
import "fmt"
/**
* 树节点结构
*/
type TreeNode struct {
value string
level int
@WGrape
WGrape / README.md
Last active January 1, 2023 07:33
Gists Introduction
@WGrape
WGrape / curlRequest.php
Created January 22, 2022 14:10
Send a simple http request by curl in PHP.
<?php
function curlRequest($url, $method = "GET", $data = "", $userPassword = "")
{
$httpHeader = array(
'Content-Type: application/json',
'Content-Length: ' . strlen($data)
);
$ch = curl_init();
@WGrape
WGrape / ElasticSearch
Last active October 6, 2022 08:59
The common queries of ElasticSearch
// 删除索引
DELETE /artist_sug_0323
GET index_name/_search
{
"query": {
"query_string": {
"default_field": "search_field",
"query": "*anything*"
}
@WGrape
WGrape / compare.php
Last active February 27, 2022 08:49
Compare whether the two values are the same In PHP
<?php
function isAssocArray($var): bool
{
return array_diff_assoc(array_keys($var), range(0, sizeof($var))) ? TRUE : FALSE;
}
function isArray($var): bool
{
return is_array($var) && !isAssocArray($var);
@megahirt
megahirt / Docker with XDebug.md
Last active July 3, 2024 22:58
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective