Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • ThomasPowell 10:55 am on September 2, 2022 Permalink | Reply  

    Windows command equivalent to which 

    If you’re used to working in a unix-like, you’ve probably made use of the which command to find an executable… but what is the Windows command equivalent?

    which - Windows command equivalent where

    Windows command equivalent: Command Prompt version – where

    where executable_file_name will return the location of any executable file in the path that can be invoked by that file name. where more will find more.com and where cmd will find cmd.exe and print out the full path to each.

    PowerShell version – Get-Command

    Get-Command (or its alias gcm) will return an object representing the command that can be invoked by that name. If it is a distinct executable file, you can retrieve the string representation of the path by wrapping the invocation in parentheses and added .path to extract the path, e.g., (gem cmd).path. This won’t return anything for cmdlets but Get-Command/gcm will return an object representing how those commands are defined, whether they are cmdlets, aliases, or distinct executables.

    PowerShell windows command equivalent to which with extra features

     
  • ThomasPowell 9:13 am on August 31, 2022 Permalink | Reply  

    Get bundle info for all gems in your bundle 

    bundle list 2>&1 | sed 's/^ \* \(.*\) (.*)/\1/' | grep -v 'bundle info' | grep -v 'bundle:' | xargs -I {} bundle info {}
    view raw bundle_info_all hosted with ❤ by GitHub
    bundle info
     
  • ThomasPowell 3:51 pm on August 26, 2022 Permalink | Reply  

    Open GitHub PR URL by number from macOS 

    Sometimes you want to be able to open a GitHub PR URL in your default browser in macOS with just the number of the PR. This can be accomplished with the following function in zsh, which can be added to your .zshrc:

    function seepr() {
      open `git remote -v | grep push | sed 's/.*github.com:\(.*\).git.*$/https:\/\/github.com\/\1\/pull\//'`$1
    }
    

    Some caveats to using this code:

    • This assumes that you’re in a local copy of the repository of the PR you want to open up in the browser.
    • You’re using SSH (git@github.com:org/repo.git) URLs instead of https.

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel
%d bloggers like this: