Skip to content

Instantly share code, notes, and snippets.

View bhank's full-sized avatar

Adam Coyne bhank

  • Coyne Solutions, Inc.
  • St. Paul, MN
View GitHub Profile
@bhank
bhank / conda.lua
Created June 23, 2020 01:52
Some clink autocompletions for Anaconda
local w = require('tables').wrap
local path = require('path')
-- https://stackoverflow.com/questions/59788504/how-to-use-the-clink-lua-api
-- https://github.com/vladimir-kotikov/clink-completions/blob/master/chocolatey.lua
local parser = clink.arg.new_parser
local envs = function (token)
envdir = clink.get_env('conda_prefix_1')

Keybase proof

I hereby claim:

  • I am bhank on github.
  • I am coynea (https://keybase.io/coynea) on keybase.
  • I have a public key ASBCne7N-xdqgyKBwBkp4H20Dcl6-nqynmwgXC1_k8esZAo

To claim this, I am signing this object:

@bhank
bhank / CustomizedCmdInit.cmd
Created July 18, 2017 03:57
Tweaked version of ConEmu CmdInit.cmd to move the prompt to a new line
@rem Copied from C:\Program Files\ConEmu\ConEmu
@echo off
rem Simple "ver" prints empty line before Windows version
rem Use this construction to print just a version info
cmd /d /c ver | "%windir%\system32\find.exe" "Windows"
rem Now we form the command prompt
@bhank
bhank / tgit.cmd
Last active June 23, 2020 00:06
Batch file for launching TortoiseGit commands
@ECHO OFF
SET GITCOMMAND=%1
SET GITPATH=%2
SET GITPARAMS=%3
IF "%GITCOMMAND%"=="" GOTO :EOF
IF NOT "%GITPATH%"=="" SET GITPATH=/path:%GITPATH%
IF /I "%GITCOMMAND%"=="ci" SET GITCOMMAND=commit
IF /I "%GITCOMMAND%"=="status" SET GITCOMMAND=repostatus
IF /I "%GITCOMMAND%"=="s" SET GITCOMMAND=repostatus
IF /I "%GITCOMMAND%"=="refs" SET GITCOMMAND=refbrowse
@bhank
bhank / git_checkout.lua
Last active March 16, 2023 23:09 — forked from sweiss3/git_checkout.lua
A clink script for supporting tab-completion of git branches when using "git checkout"
-- Ctrl-Q in conemu to reload Clink Lua scripts
-- Clink match generators: https://github.com/mridgers/clink/blob/master/docs/clink.md#user-content-match-generators
-- Strings: http://lua-users.org/wiki/StringLibraryTutorial
-- Patterns: http://lua-users.org/wiki/PatternsTutorial
-- Escaping: http://www.lua.org/pil/20.2.html
-- local: http://www.lua.org/pil/4.2.html
-- git commands which will autocomplete branch names after them:
local git_commands = {"checkout", "co", "merge", "branch -d", "branch -D"}
@bhank
bhank / TortoiseWhicheverProc.cmd
Created September 20, 2013 00:11
A batch file to launch TortoiseProc.exe or TortoiseGitProc.exe as appropriate.
@ECHO OFF
SET FOUND=
SET SEARCHPATH=%CD%
SET LASTSEARCHPATH=
ECHO %~nx0: finding source control dir for %SEARCHPATH%
:loop
CALL :checkdir "%SEARCHPATH%"
IF NOT "%FOUND%"=="" GOTO %FOUND%
@bhank
bhank / commit.ps1
Last active December 14, 2015 17:49
Open the TortoiseSVN or TortoiseGit Commit dialog (as appropriate) showing all modified files in a Visual Studio solution by running Tortoise-CommitSolution in the Package Manager Console.
# Tortoise-CommitSolution by Adam Coyne <adam@coyne.nu>
# Edit your NuGet PowerShell profile ($Env:UserProfile\Documents\WindowsPowerShell\NuGet_profile.ps1) to source this file (like ". $Env:UserProfile\Documents\WindowsPowerShell\commit.ps1") and add a convenient alias (like "Set-Alias commit Tortoise-CommitSolution")
function Tortoise-CommitSolution {
[string[]]$projectpaths = Get-Project -All | foreach { [System.IO.Path]::GetDirectoryName($_.FullName) }
$projectpaths += $dte.Solution.FullName
if($projectpaths.length -gt 0) {
$filename = Write-PathFile(Filter-PathArray($projectpaths))
# Visual Studio is 32-bit, but I have 64-bit TortoiseSvn and TortoiseGit installed
$programfiles = $Env:ProgramW6432
if(!$programfiles) { $programfiles = $Env:ProgramFiles }