Skip to content

Instantly share code, notes, and snippets.

View wowiwj's full-sized avatar
🌴
On vacation

王举 wowiwj

🌴
On vacation
  • Atommatrix
  • Nanjing
View GitHub Profile
@wowiwj
wowiwj / win_chacter.php
Created August 26, 2019 14:46
windows character convert
<?php
function u8($str)
{
if (mb_detect_encoding($str, "UTF-8, ISO-8859-1, GBK") != "UTF-8") {
return iconv("gbk", "utf-8", $str);
}
return $str;
}
if [ "$TERM"="linux" ] ;then
export LANGUAGE=en_US
export LANG=en_US.UTF-8
fi
export PATH="$HOME/.cargo/bin:$PATH"
alias uzipz="unzip -O cp936"
alias 'open'='xdg-open'
@wowiwj
wowiwj / TreeUtil.php
Created July 23, 2019 11:25
Collection 快速创建树形结构
<?php
namespace app\common\util;
use Illuminate\Database\Eloquent\Collection;
class TreeUtil
{
#!/bin/sh
# bitnami开发laravel辅助shell
# laravel 镜像地址
# https://hub.docker.com/r/bitnami/laravel
#
# docker开发流程
# 1. 创建app目录
# $ mkdir web-app && cd web-app
# 2. 拉取compose文件
@wowiwj
wowiwj / docker-compose.yml
Last active June 25, 2022 19:56
code-server docker-compose file
version: 2
services:
code-server:
image: codercom/code-server
volumes:
- ~/projects:/root/project
ports:
- 8443:8443
command: "--allow-http --password=xxxxxx"
@wowiwj
wowiwj / export_mysql_table_schema_to_markdown_table
Created November 28, 2018 03:15
导出数据库的结构为markdown文件脚本
#!/usr/bin/env php
<?php
if (count($argv) == 1) {
throw new InvalidArgumentException('Missing tables');
}
$tables = array_slice($argv, 1);
$db = new PDO('mysql:dbname=requisition;host=127.0.0.1;charset=utf8mb4', 'root', '123456');
foreach ($tables as $table) {
$query = $db->query("SHOW FULL COLUMNS FROM $table");
@wowiwj
wowiwj / tp-php_cs
Created November 19, 2018 08:15
tp php_cs格式化配置文件
<?php
$excluded_folders = [
'TmsLogs',
'Public',
'BiFtpFile'
];
$finder = Symfony\Component\Finder\Finder::create()
->in([__DIR__])
->notPath('*/Runtime')
->exclude($excluded_folders)
@wowiwj
wowiwj / fix-php.sh
Created November 19, 2018 07:52
格式化修改的php文件
#!/bin/bash
echo "Running PHP-CS-Fixer"
files=$(git diff --name-only)
if [ ${#files} -eq 0 ];then
echo "Any files has no changed,skip!"
else
git diff --name-only | xargs -n1 php-cs-fixer fix
@wowiwj
wowiwj / task.sh
Created February 2, 2018 07:52
task启动工作流
#!/bin/bash
echo "工作流启动中";
# 打开phpstorm
open /Applications/PhpStorm.app
# 启动homestead
cd ~/Homestead && /usr/local/bin/vagrant up
@wowiwj
wowiwj / eslintrc.json
Last active October 15, 2019 10:11
VSCode个人配置
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:vue/recommended"