This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# backup the PATH | |
pathBak="$PATH" | |
# echo "$BASH_VERSION" | |
# 声明关联数组(bash > 4.2 版本) | |
declare -A env_paths=( | |
[node20]="/c/Users/inhere/workspace/env/node-sdk/node-v20.16.0-win-x64" | |
[node16]="/c/Users/inhere/workspace/env/node-sdk/node-v16.16.0-win-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by PhpStorm. | |
* User: inhere | |
* Date: 2017/5/9 | |
* Time: 下午10:55 | |
*/ | |
namespace inhere\gearman\tools; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# link https://github.com/humbug/box/blob/master/Makefile | |
#SHELL = /bin/sh | |
# 每行命令之前必须有一个tab键。如果想用其他键,可以用内置变量.RECIPEPREFIX 声明 | |
# mac 下这条声明 没起作用 !! | |
.RECIPEPREFIX = > | |
.PHONY: all usage help clean | |
# 需要注意的是,每行命令在一个单独的shell中执行。这些Shell之间没有继承关系。 | |
# - 解决办法是将两行命令写在一行,中间用分号分隔。 | |
# - 或者在换行符前加反斜杠转义 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function format_mdtable2sql(string $mdStr): string | |
{ | |
$lines = array_values( | |
array_filter( | |
explode("\n", trim($mdStr)) | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alist = document.getElementById('sidebar').getElementsByTagName('a') | |
for (var i=0; i < alist.length; i++) { | |
// console.log(i, alist.item(i).href) | |
fetch(alist.item(i).href) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
namespace App\Common; | |
use ReflectionException; | |
use Swoft\Bean\Annotation\Mapping\Bean; | |
use Swoft\Bean\Annotation\Mapping\Inject; | |
use Swoft\Bean\Exception\ContainerException; | |
use Swoft\Consul\Agent; | |
use Swoft\Consul\Exception\ClientException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
namespace App\Model\Logic; | |
use Exception; | |
use Swoft\Bean\Annotation\Mapping\Bean; | |
use Swoft\Breaker\Annotation\Mapping\Breaker; | |
/** | |
* Class BreakerLogic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# | |
#set -e | |
# import common functions | |
source "$(dirname $0)/common-func.sh" | |
function show_help() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# some common functions | |
# Usage: | |
# user_confirm | |
# user_confirm "custom question" | |
function user_confirm() { | |
local yes=0 | |
local msg="Confirm continue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#set -e | |
# import common functions | |
source "$(dirname $0)/common-func.sh" | |
binName="bash $(basename $0)" | |
if [[ -z "$1" ]] |
NewerOlder