From d6ab203569868cf73199fbe52e04d722f0c5a02e Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 24 May 2020 17:34:16 +0800 Subject: [PATCH 1/2] [misc] fallback to c-b prefix --- tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmux.conf b/tmux.conf index 0a9cc42..275865c 100644 --- a/tmux.conf +++ b/tmux.conf @@ -15,7 +15,7 @@ set-option -g display-time 4000 ############################ setw -g mode-keys vi set -g status-keys vi -set -g prefix C-h +# set -g prefix C-h bind-key c new-window -c '#{pane_current_path}' bind-key '"' split-window -c '#{pane_current_path}' bind-key % split-window -h -c '#{pane_current_path}' From 281f470dffe13626a4a1d76f246decbdfe43b4e2 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 24 May 2020 17:34:33 +0800 Subject: [PATCH 2/2] [feature] add bing dict --- win/profile.ps1 | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/win/profile.ps1 b/win/profile.ps1 index bfd98a9..301614d 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -4,8 +4,16 @@ Set-PSReadLineOption -EditMode Emacs +$Env:Path += ";$PSScriptRoot\bin" -Function dp ($Word) { +function dp { + [CmdletBinding()] + param ( + [Parameter(Mandatory=$true,ValueFromRemainingArguments)] + [String[]] + $words + ) + $word = $words | Join-String -Separator ' ' Add-Type -AssemblyName presentationCore $tmpPath = Join-Path -Path $env:Temp -ChildPath 'sound.mp3' Invoke-WebRequest -Uri "http://dict.youdao.com/dictvoice?audio=$Word&type=1" -OutFile $tmpPath @@ -16,3 +24,26 @@ Function dp ($Word) { $mediaPlayer.Close() } +function d { + [CmdletBinding()] + param ( + [Parameter(Mandatory=$true,ValueFromRemainingArguments)] + [String[]] + $words + ) + $word = $words | Join-String -Separator ' ' + $res = Invoke-WebRequest -Uri "https://cn.bing.com/dict/search" -Method GET -Body @{q=$word} + if ($res.Content -match '') { + $explain = $Matches[1] -replace '必应词典为您提供.+的释义,(.+)','$1' + $explain = $explain -replace ' 网络释义',"`r`n网络释义" + $explain = $explain -replace ',',"`r`n" + Write-Host $explain + } else { + throw 'meta description not found' + } +} + +function vsbuild { + Import-Module "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll" + Enter-VsDevShell 56e7bf1c +} \ No newline at end of file