Skip to content

Instantly share code, notes, and snippets.

View Zhwt's full-sized avatar
┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻

Zhwt Zhwt

┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻
  • Earth
View GitHub Profile
@Zhwt
Zhwt / default
Created November 27, 2018 01:22 — forked from dtomasi/default
Brew Nginx PHP7
server {
listen 80;
server_name localhost;
root /Users/YOUR_USERNAME/Sites;
access_log /Library/Logs/default.access.log main;
location / {
include /usr/local/etc/nginx/conf.d/php-fpm;
}
@Zhwt
Zhwt / ThinkPHP 5.1 集成 PHPUnit 8 测试框架.md
Last active October 27, 2023 06:47
ThinkPHP 5.1 集成 PHPUnit 8 测试框架

ThinkPHP 5.1 集成 PHPUnit 8 测试框架

本项目仅适用于运行 PHP7.2 以上的环境!对于低版本 PHP 请根据需要调整 PHPUnit 的版本!

版本号参考

PHP 版本 PHPUnit 版本
7.3, 7.2 8
7.1 (仅安全更新,2019 年 12 月 1 日起停止支持) 7
@Zhwt
Zhwt / .gitignore
Last active May 6, 2020 03:13
.gitignore file for Go projects
# JetBrains intelliJ IDE config
.idea/
*.ipr
*.iml
*.iws
# VS Code
.vscode/
# VIM Editor temporary files
@Zhwt
Zhwt / README.md
Last active April 10, 2020 10:38 — forked from jhoff/README.md
Bash-only Laravel Artisan tab auto-complete

This version uses a little cache mechanic to reduce waiting time between pressing tabs.

If you are an Oh-my-zsh user, see the Laravel 5 plugin

For the rest of us Bash users, all of the Laravel Artisan autocomplete solutions out there require installing a composer package to get a list of artisan commands. Turns out this isn't really necessary. Simply add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system.

ARTISAN_COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
_artisan()
{
@Zhwt
Zhwt / shell.sh
Created October 28, 2020 03:51
In case you need to find out the IP with most failed login tries...
lastb | tr -s ' ' | cut -d ' ' -f 3 | sort | uniq -c | sort
@Zhwt
Zhwt / number_to_words.sh
Created June 4, 2024 02:23
Convert number to English words in bash
#!/bin/bash
number_to_words() {
num=$1
if [ "$num" -eq 0 ]; then
echo "zero"
return 0
fi
@Zhwt
Zhwt / cidraggr.go
Created June 17, 2024 03:35
Go tool for merging CIDR ranges.
package main
import (
"bufio"
"fmt"
"log"
"net/http"
"net/netip"
"os"