This file contains hidden or 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 python3 | |
import logging | |
import re | |
import shutil | |
import subprocess | |
from argparse import ArgumentParser, RawDescriptionHelpFormatter | |
from os import fdopen, unlink | |
from pathlib import Path | |
from tempfile import mkstemp |
This file contains hidden or 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 | |
# todo | |
# follow convention | |
# * echo -n | awk '{ print $0 }' | |
# * echo | awk '{ print $0 }' | |
read_escape() { | |
while read -r filename; do | |
escape $filename |
This file contains hidden or 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
function recover-last-version | |
{ #{{{ | |
local commit_ref=$1 | |
if [ ! "${commit_ref}" ]; then return 2; fi | |
for i in $(git diff HEAD "${commit_ref}" --name-only); do | |
vim -c 'Gvsplit HEAD~1:% | windo diffthis' -- "${i}" | |
done; | |
} #}}} |
This file contains hidden or 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
# 读取管道中传递的文件, 并用vim打开 | |
function vip | |
{ # {{{ | |
local lines='' | |
# 从管道中读取 | |
while read x; do | |
if [[ ! "${x}" ]]; then continue; fi | |
# 绝对路径, 忽略文件夹 | |
x="$(realpath $x)" |
This file contains hidden or 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 | |
namespace app\modules\stuff\oauthclients; | |
use CURLFile; | |
use yii\authclient\OAuthToken; | |
use yii\base\DynamicModel; | |
use yii\web\HttpException; | |
use yii\helpers\Json; |
NewerOlder