Live data from Hacker News

Facebook PathPicker

facebook.github.io

71–80 of 168 posts

Re: Facebook PathPicker

#71
post #32

Earlier quoted context omitted.

Very cool tool. Just curious as to why directories are not selectable. I did "ls | fpp" and everything got listed (directories and files) but only the files were selectable.

Yeah, we don't match on directories since the regex would overmatch other results (we would basically have to match anything that is words with a slash). However if we added support for checking for file / directory existence we could definitely add support for that

I think if you added the ability to traverse directories, that would take this tool to the next level. I kind of expected the tool to be similar to NERD Tree or Vim's explorer, which would be incredibly useful.

Re: Facebook PathPicker

#72

I use fzf[0] for similar purposes. [0] https://github.com/junegunn/fzf

Yeah fzf is great -- there are a few differences since PathPicker can execute any command with the selected file(s) (rather than just write it to stdout) and runs in tmux with no issues, but fzf has great vim integration and I believe actually verifies the file matches. Glad more people are working in the productivity space though!

The fact that it just outputs to stdout means you can run any command with output from fzf as well. Just

anycommand $(fzf)

Re: Facebook PathPicker

#73
post #63

Hey guys, great tool. Just want to point out it doesn't play well with ack (a better grep) because ack does not prepend a "./" to the file list returned from "ack -l 'foo'". Any way to make it work with the following: junk/foo/bar.txt instead of just ./junk/foo/bar.txt ?

Please, this!

Re: Facebook PathPicker

#74

Hey everyone, I'm in the main engineer on this project if anyone has questions. Facebook has a large codebase, so naturally we have a lot of long filenames and paths. It's a pain to type these out by hand, so I'd see a lot of (new) engineers select the text with their mouse before pasting it into the command line. This is pretty inefficient and I knew there had to be a better way, so a few of us started hacking on a…

This looks very cool - thank you.

I've been using Pick by Thoughtbot [1] for the same purpose, but if I understand correctly fpp will automatically extract file paths from any command without me needing to chain in awk/grep ?

[1] https://robots.thoughtbot.com/announcing-pick

Re: Facebook PathPicker

#76
Dozens of cool utilities like this are created every week and launched at Show HN, but without "Facebook" in their names you need at least 10 of them to get the many points this thread has gathered.

Re: Facebook PathPicker

#77
post #70

Hey everyone, I'm in the main engineer on this project if anyone has questions. Facebook has a large codebase, so naturally we have a lot of long filenames and paths. It's a pain to type these out by hand, so I'd see a lot of (new) engineers select the text with their mouse before pasting it into the command line. This is pretty inefficient and I knew there had to be a better way, so a few of us started hacking on a…

I have been thinking about a more general tool that allows you to select text in different ways from some input, and either copy the selection into your paste ring or as fpp does. I am still thinking about different selection modes and how the UI would work. Usually I see a need to either copy several full lines, or columns from a table like structure (rectangle selection) or from a regex. Looks good so far!

urxvt supports URL highlighting, so I can just click on URLs in my terminal and they open in my web browser. It's extendable too, so pdf filenames can be made into links that open in your chosen pdf viewer. I see no reason why this couldn't be extended to arbitrary filenames in your chosen text editor.

Re: Facebook PathPicker

#78
post #43

Earlier quoted context omitted.

[pierce@plo-pro team15]$ time (find . -print0 | xargs -0 stat -f '%N' | wc -l) 4901 real 0m0.079s user 0m0.043s sys 0m0.060s

@ploxiln -- edited my comment explaining a lot of devs here use network mounts (in which case checking for existence takes a lot longer). I'd love to explore this though, either behind a config setting or eventually as the default behavior! What do you think?

You could test for a single file (possible with a timeout) and see if it's "fast enough" to check all files.

You could also check in the background and update the display if the heuristic turned out wrong.

Re: Facebook PathPicker

#79

Hey everyone, I'm in the main engineer on this project if anyone has questions. Facebook has a large codebase, so naturally we have a lot of long filenames and paths. It's a pain to type these out by hand, so I'd see a lot of (new) engineers select the text with their mouse before pasting it into the command line. This is pretty inefficient and I knew there had to be a better way, so a few of us started hacking on a…

This looks very cool - thank you. I've been using Pick by Thoughtbot [1] for the same purpose, but if I understand correctly fpp will automatically extract file paths from any command without me needing to chain in awk/grep ? [1] https://robots.thoughtbot.com/announcing-pick

Yeah, that seems to be the idea. It has a bunch of regexes for parsing different kinds of outputs, and some fallback ones.

Re: Facebook PathPicker

#80
Haven't we learned by now, my fellow HN readers? All of Facebook's open source "gifts" are patent Trojan horses. Go take a look at their PATENTS file before going anywhere near this stuff.

The fact that Facebook, at such a level of wealth and success, gets away with this stuff is despicable. It's also an insult to the great legacy of companies like Sun, which gave freely without strangling its beneficiaries. It says a lot about the culture and leadership at the company, but that's been well-documented...

If you're a passionate engineer at Facebook working on an open source project, please go work on it somewhere else!

Post reply on HN