fool

joined 1 year ago
[–] fool@programming.dev 1 points 4 days ago

trawl your boss

[–] fool@programming.dev 1 points 4 days ago (2 children)

Weaving up the wire thingies on chain link fences? What'd you need that for -- did your property fence get a huge hole from a burglar or something?

[–] fool@programming.dev 2 points 4 days ago (1 children)

Wow, that's definitely a few. Didn't expect an entire set of chainmail to show up in these comments!

And I seem to notice something:

...the armor. But because I want to be done in less than a year (will be part of my wedding outfit)

"Hey, what if I not only learn to play the [Hurdy (Nerdy?) Gurdy, but also learn to play it for my wedding"

Someone's wedding is going to be very interesting.

[–] fool@programming.dev 1 points 4 days ago

I went to Yalemacs for my Comparative Text Editors PhD

[–] fool@programming.dev 3 points 6 days ago (1 children)

Yeah it just feels super different. Somehow it tastes different too.

It's like drinking water out of a red plastic/solid cup vs. a nice clear glass. Or eating sushi using chopsticks instead of by spoon or fork or something.

I wouldn't eat sushi without em :^)

[–] fool@programming.dev 2 points 6 days ago (1 children)

HOA docs didn't even cross my mind, that's resourceful.

Has the AI been particularly accurate, and does it cite where it found your information? With more technical stuff it's always confidently wrong

ty for the response btw

[–] fool@programming.dev 2 points 6 days ago (5 children)

Nice, AI with half of the suspicion removed.

Does it save you a lot of time, what do you use it for? I have a somewhat old GPU but have been considering something like this to comb manuals. Does it have a file size constraint?

[–] fool@programming.dev 1 points 6 days ago

Cool! I'll probably try climbing some day, since sportsball never motivated me to stick on. (And bc of the functional muscle vs. gym muscle stereotype.)

As for infinite Indiana Jones... I'm trying my best to keep the songs I whistle different haha

[–] fool@programming.dev 1 points 6 days ago (1 children)

Nice. kdenlive or something else?

Also -- upscale video? Don't you run it through some real esrgan thing and wait for forever? I'm working on trying to upscale a video right now but my GPU is ancient

[–] fool@programming.dev 3 points 6 days ago* (last edited 6 days ago) (1 children)

What'd you learn it for (I personally don't see it often so you likely live near a Cyrillic-heavier region) and how? Also

[–] fool@programming.dev 2 points 6 days ago (1 children)

I can take a pen apart...

Did you have a lot of prior handy experience or did you follow a video? This is a bit vague on the how
( ' ﹋ ' ; )

[–] fool@programming.dev 11 points 6 days ago (1 children)

Done.

  • How dangerous really is your job?
  • What happens if you get injured? Insurance/etc.?
  • What differences do you have when performing for adults vs. children? (since you mention child-friendly, I assume that means you don't do things that might scare them)
  • What are your least tame skills?
  • How did you get into performing in the sideshow? Mentors, training, string of coincidences?
  • Favorite memory?
  • Any frightening memories?

Sorry for the wall x)

1
submitted 5 months ago* (last edited 5 months ago) by fool@programming.dev to c/linux@lemmy.ml
 

I have a little helper command in ~/.zshrc called stfu.

stfu() {
    if [ -z "$1" ]; then
        echo "Usage: stfu <program> [arguments...]"
        return 1
    fi

    nohup "$@" &>/dev/null &
    disown
}
complete -W "$(ls /usr/bin)" stfu

stfu will run some other command but also detach it from the terminal and make any output shut up. I use it for things such as starting a browser from the terminal without worrying about CTRL+Z, bg, and disown.

$ stfu firefox -safe-mode
# Will not output stuff to the terminal, and
# I can close the terminal too.

Here’s my issue:

On the second argument and above, when I hit tab, how do I let autocomplete suggest me the arguments and command line switches for the command I’m passing in?

e.g. stfu ls -<tab> should show me whatever ls’s completion function is, rather than listing every /usr/bin command again.

# Intended completion
$ stfu cat -<TAB>
-e                      -- equivalent to -vE                                                                                                                                                     
--help                  -- display help and exit                                                                                                                                                 
--number            -n  -- number all output lines                                                                                                                                               
--number-nonblank   -b  -- number nonempty output lines, overrides -n                                                                                                                            
--show-all          -A  -- equivalent to -vET                                                                                                                                                    
--show-ends         -E  -- display $ at end of each line                                                                                                                                         
--show-nonprinting  -v  -- use ^ and M- notation, except for LFD and TAB                                                                                                                         
--show-tabs         -T  -- display TAB characters as ^I                                                                                                                                          
--squeeze-blank     -s  -- suppress repeated empty output lines                                                                                                                                  
-t                      -- equivalent to -vT                                                                                                                                                     
-u                      -- ignored  

# Actual completion
$ stfu cat <tab>
...a list of all /usr/bin commands
$ stfu cat -<tab>
...nothing, since no /usr/bin commands start with -

(repost, prev was removed)

EDIT: Solved.

I needed to set the curcontext to the second word. Below is my (iffily annotated) zsh implementation, enjoy >:)

stfu() {
  if [ -z "$1" ]; then
    echo "Usage: stfu <program> [arguments...]"
    return 1
  fi

  nohup "$@" &>/dev/null &
  disown
}
#complete -W "$(ls /usr/bin)" stfu
_stfu() {
  # Curcontext looks like this:
  #   $ stfu <tab>
  #   :complete:stfu:
  local curcontext="$curcontext" 
  #typeset -A opt_args # idk what this does, i removed it

  _arguments \
    '1: :_command_names -e' \
    '*::args:->args'

  case $state in
    args)
      # idk where CURRENT came from
      if (( CURRENT > 1 )); then
        # $words is magic that splits up the "words" in a shell command.
        #   1. stfu
        #   2. yourSubCommand
        #   3. argument 1 to that subcommand
        local cmd=${words[2]}
        # We update the autocompletion curcontext to
        # pay attention to your subcommand instead
        curcontext="$cmd"

        # Call completion function
        _normal
      fi
      ;;
  esac
}
compdef _stfu stfu

Deduced via docs (look for The Dispatcher), this dude's docs, stackoverflow and overreliance on ChatGPT.

EDIT: Best solution (Andy)

stfu() {
  if [ -z "$1" ]; then
    echo "Usage: stfu <program> [arguments...]"
    return 1
  fi

  nohup "$@" &>/dev/null &
  disown
}
_stfu () {
  # shift autocomplete to right
  shift words
  (( CURRENT-=1 ))
  _normal
}
compdef _stfu stfu
view more: ‹ prev next ›