Skip to content

Instantly share code, notes, and snippets.

View zhanghuid's full-sized avatar
🎯
Focusing

Huid zhanghuid

🎯
Focusing
View GitHub Profile
@zhanghuid
zhanghuid / 基于 docker 搭建不同版本的 fpm 环境.md
Last active November 7, 2023 02:50
在 已有 nginx 的情况下,基于 docker 搭建不同版本的 fpm 环境

举个栗子

  1. 安装 php8.2 的fpm
docker pull php:8.2-fpm
  1. 启动容器

挂载目录时,指定容器内的 fpm 用户,防止由于默认的 挂载权限(root)导致的异常 File Not Found

@zhanghuid
zhanghuid / fix_ST3_or_4.md
Created September 18, 2023 03:49
[ST3/4] Package Control not working on macOS #1612

Package Control will be uppraded next time package update is triggered, either by automatic updates at ST startup or by manually calling "Package Control: Upgrade All Packages/Overwrite All" via Command Palette.

In case PC3.x is not working, you can

  1. download https://github.com/wbond/package_control/releases/download/4.0.0-beta2/Package.Control.sublime-package
  2. call Main Menu > Preferences > Browse Packages...
  3. navigate to to ../Installed Packages
  4. move downloaded package into Installed Packages and rename it to Package Control.sublime-package (replace the . by ).
@zhanghuid
zhanghuid / alacritty.md
Last active February 14, 2023 08:01
alacritty muti config
<?php
Builder::macro('deferredPaginate', function ($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) {
$model = $this->newModelInstance();
$key = $model->getKeyName();
$table = $model->getTable();
$paginator = $this->clone()
// We don't need them for this query, they'll remain
// on the query that actually gets the records.
@zhanghuid
zhanghuid / remove-csv-bom.md
Created June 29, 2022 16:50
for read csv, fix some wrong string
<?php
    $bom = pack('CCC', 0xEF, 0xBB, 0xBF);
    if (strncmp($yourString, $bom, 3) === 0) {
        $body = substr($yourString, 3);
    }
?>

>refer

@zhanghuid
zhanghuid / clash-restful-api.md
Last active March 16, 2022 10:17
Clash - restful api
  • swith node
curl -X PUT \
  -H "Content-Type: application/json" \
  -d '{"name":"HongKong"}' http://127.0.0.1:9090/proxies/Proxy
  • reload
curl -X PUT \
@zhanghuid
zhanghuid / mount_smbfs.sh
Created February 25, 2022 05:58 — forked from natritmeyer/mount_smbfs.sh
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:[email protected]/share_name share_name/
@zhanghuid
zhanghuid / ps-time.md
Last active July 2, 2020 03:13
ps 命令查看进程启动的精确时间和启动后所流逝的时间
@zhanghuid
zhanghuid / create-database.sql
Created February 7, 2020 06:20
create database
CREATE DATABASE
IF
NOT EXISTS RUNOOB DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci;
{
"args":
{
"target": "browser"
},
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Monokai (SL).tmTheme",
"command": "markdown_preview",
"ensure_newline_at_eof_on_save": true,