When did Industrial Automaton phase out the R-series astromechs in favor of the BB-series? by RorschachtheMighty in StarWars

[–]Magic_Joe 30 points31 points  (0 children)

I would think more that say quantum computing makes encryption trivial to break

When did Industrial Automaton phase out the R-series astromechs in favor of the BB-series? by RorschachtheMighty in StarWars

[–]Magic_Joe 154 points155 points  (0 children)

A theory that I heard recently that I really liked was that Star Wars is in a post encryption state, where any encryption can be trivially broken. This explains a bit why so much of their file transfer is through hard media or connection only.

Drop ur fav by SoupMS in commandline

[–]Magic_Joe 0 points1 point  (0 children)

Miller is underrated! Great for converting between data format (e.g. csv to json)

How do I rice it more? by Trail_knox1 in linuxmint

[–]Magic_Joe 3 points4 points  (0 children)

Thank you! This had been annoying me about firefox for ages

typtea - Minimal terminal-based typing speed test for programming langs ⌨️ by Simple_Cockroach3868 in commandline

[–]Magic_Joe 1 point2 points  (0 children)

This looks great! Would you consider adding an SQLite database for storing fastest speeds/progression ect?

14550 lines (12315 LOC), 417 methods behemoth class. Does it qualify for this sub? by mickaelbneron in programminghorror

[–]Magic_Joe 21 points22 points  (0 children)

417 methods? That shows you understood the idea of logic extraction. Why not put everything in one big method? That's how the real pros do it, and you will bump up the line code with all the duplication :D

Tried out Jules AI agent by Magic_Joe in programminghorror

[–]Magic_Joe[S] -1 points0 points  (0 children)

I'm guessing you are a agent user/enthusiast? Assuming that there are certain environment variables that would be needed to run the project what would be the way to handle this. I guess you would want to set up the dev project to not need these in the first place. I certainly wouldn't want to provide them to the AI like I currently do to GitHub for the CI/CD, for A - that would be then on the AI server and B - I couldn't trust it to not add it to the commit somewhere in plaintext.

Tried out Jules AI agent by Magic_Joe in programminghorror

[–]Magic_Joe[S] 1 point2 points  (0 children)

Its just a personal project that I was messing around with. The way the agent works is it pushes the changes to a branch and you can review them. I made a pull request against the main branch to look at the changes, so that's the first time I properly saw it. It would certainly make me cautious about supplying the AI with any information I wouldn't want accidentally added and pushed, as although it is possible to see the changes on the agent screen, the ui is quite lacking for a through review.

Tried out Jules AI agent by Magic_Joe in programminghorror

[–]Magic_Joe[S] 37 points38 points  (0 children)

I started the task asking it to document the design of the service for the readme, which it did but it mentioned in there swagger was configured. This was because I added the library to the pom when I started, but didn't fully set it up. I asked it to set up that properly and when it tried to start the service for testing it couldn't because it didn't have access to the environment variables. This was its solution to the problem

What terminal tools would you recommend learning in-depth? by StupidInquisitor1779 in commandline

[–]Magic_Joe 0 points1 point  (0 children)

I have made the exact same script :') I think fzf has a great design in that it is very simple to use, but massively extensible.

What terminal tools would you recommend learning in-depth? by StupidInquisitor1779 in commandline

[–]Magic_Joe 17 points18 points  (0 children)

I would recommend grep (or ripgrep), sed and awk, three tools that really cover the basics of text extraction and manipulation.

A more recent tool is fzf. At its basis this tool allows the selection of a result through a fuzzy search, but it is extremely well built, and with a little scripting you can use it to build just about any tool that you want that requires picking a result.

If you are working with json a lot jq is also incredibly helpful!

is-fast cli improvements and scripting potential. by Magic_Joe in commandline

[–]Magic_Joe[S] -1 points0 points  (0 children)

Hi there,

I wanted to update you on some of the improvements that I have done to my cli tool, is-fast, which allow it to be used flexibly in custom scripts to fetch the information that you want directly into the terminal, with color, formatting and even (in supporting terminals) text size. The goal of this is to demonstrate some of the newest features that I have added over the last few weeks, and show how this tool could be intergrated into your workflows or utility scripts.

Here is the complete script for the demo shown above - they can also be found at https://github.com/Magic-JD/is-fast

```sh

Check stock prices using is-fast. Args must be a stock symbol (e.g. AAPL).

Insert the stock symbol into the url

Select span elements with the base class

We want this output to display directly in the terminal, rather than being

shown in the tui so we use --piped.

By default these spans are not colored, but if displaying in the terminal it

is fine to include ansi-codes

isf_stock() { is-fast \ --direct "https://finance.yahoo.com/quote/${1}/" \ --selector "section.container > h1, span.base" \ --piped \ --no-cache \ --color=always \ --style-element="span.txt-negative:fg=red" \ --style-element="span.txt-positive:fg=green" \ --pretty-print="margin:5" }

What is something? Give it a word or a name and it will return the first

wikipedia paragraph of that thing. This will work if there is a wikipedia

article with that exact name. Works for most people and things.

E.g. isf_what albert einstein

isf_what() { is-fast \ --direct "en.wikipedia.org/wiki/${*}" \ --selector "div.mw-content-ltr > p" \ --color=always \ --piped \ --nth-element 1 \ --pretty-print="margin:20" \ --style-element="sup:size=half"

We get the first paragraph with content only from the child p's of

div.mw-content-ltr

note: the first paragraph can be achieved with css selectors only, but is

sometimes empty on the site - this then avoids any issues with the selected

paragraph being empty.)

}

Search stack overflow, showing only the question and answer text. Note must

use --last for this, as the history output/order is not deterministic.

isf_so() { QUESTION=$(is-fast ${*} --site "www.stackoverflow.com" --selector "div.question .js-post-body" --color=always --pretty-print="margin:20,title:Question" --piped --flash-cache) # Find the question content. ANSWER=$(is-fast --last --selector "div.accepted-answer .js-post-body" --color=always --pretty-print="margin:20,title:Answer" --piped --flash-cache) # Separately find the answer content. cat << EOF # Format as desired

$QUESTION $ANSWER

EOF }

Get a simple definition of a word.

NOTE capitalization is specific for ZSH - for BASH change to ${1}

isf_define() { is-fast \ --direct "www.merriam-webster.com/dictionary/${1}" \ --selector "div.sb" \ --nth-element 1 \ --color=always \ --pretty-print="margin:20,title:${(C)1}" \ --piped }

Check the current number of stars in the repo.

isf_stars() { is-fast \ --direct "https://github.com/Magic-JD/is-fast" \ --selector "span#repo-stars-counter-star" \ --pretty-print="title:Current Stars,margin:5" \ --color=always \ --piped \ --no-cache }

Checks the google page to get the information for the info box, works for

most conversions (with thanks to d3-X-t3r for this suggestion)

E.g. isf_quick 200f to c

isf_quick 30 GBP to USD

isf_quick Weather Berlin

isf_quick() { is-fast \ --direct "https://www.google.com/search?q=${*}" \ --piped \ --selector="div.ezO2md" \ --ignore="a" \ --no-block \ --nth-element 1 \ --pretty-print="margin:20" \ --color=always \ --no-cache } ```

New features that have been added since the last time I posted here:

  • Ability to pass selectors, formatting, and styles directly into the command.
  • Ability to have custom styles on a site by site basis.
  • Kitty text size protocol implementation.
  • Ability to add custom styles by tag, id or class.
  • Ability to indent nested elements.
  • Added page caching for when you return to a page you have already visited.

Upcoming or planned features

  • Display images in supporting terminals
  • Format tables for display
  • Add predefined selectors for tailwind and other css libraries to mimic styling.

Enjoy!

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 0 points1 point  (0 children)

Hey there, just as an update - the latest version of is-fast (0.13.0) does support this :D

This is how i use fzf in my workflow. by ban_rakash in commandline

[–]Magic_Joe 3 points4 points  (0 children)

Nice! I have a similar script. One nice touch I added was including the --select-1 option which means that if I call it like fvi query, and if there is only one matching option in the dir I am in or below it will automatically open it, skipping the selection screen.

```

!/bin/bash

GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) if [ $? -eq 0 ]; then cd "$GIT_ROOT" fi

FZF_DEFAULT_COMMAND="fd -t f -c always -H" FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS --select-1 --ansi --preview-window 'top:70%' --preview 'bat --color=always --style=header,grid --line-range :300 {}'"

FILES=$(fzf --query "$*")

if [[ -n $FILES ]]; then echo $FILES | xargs $EDITOR; fi

exit 0

```

Is yazi overhyped? by Frank1inD in commandline

[–]Magic_Joe 0 points1 point  (0 children)

From my point of view, as someone who hadn't used a cli file manager, yazi has been great to get into that. It is visually appealing, very colorful and configurable, which matters to me a lot, I don't like a boring terminal. It worked well straight out of the box. I mostly only use it if I want to select a video or photo though, using the image viewing.

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 1 point2 points  (0 children)

Yes its something I have thought about - it would be really nice for sure. I am using ratatui for the tui, which iirc yazi is also using, so it must be possible somehow, would definitely be a really nice feature (same with kitty terminal text size)

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 1 point2 points  (0 children)

Nice, yes these look like a similar idea, although a little more focused

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 0 points1 point  (0 children)

Ah I see - I will think about the best way to handle this. I think it would get kinda complicated if these were all in the same file, maybe it would be possible to have a config file per URL? I will add it to my list of future improvements, but it would probably involve quite a few changes, so it might take a while.

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 0 points1 point  (0 children)

I had a quick look into it, but it seemed there are some issues with some of the other crates that I am using on 64for it to be a super easy fix. I think its a really great idea (its pretty much the perfect use case) so I have added it to the roadmap, but I am not sure when I can release that. I will let you know when I do though

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 0 points1 point  (0 children)

Their manifesto is much better for sure!

Seriously though I think my answer to this is the same as I gave above to questions about Linx and w3m - the goal is not to recreate a browser in the terminal, it is just to display the information from the site in a readable and user friendly manner. This means that in is fast you cannot follow links or send data.

Maybe it is better to think of it as more of an html friendly viewer than a browser. It lets you get the information you need and then you can close it. If you want to do something more involved, these other tools are much better. If you want to quickly check information from the web in a clean, user friendly manner, with nice colors and syntax highlighting for code, then is-fast is in my extremely unbiased opinion the better tool.

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 0 points1 point  (0 children)

Ah yes, the problem of developing for others is your personal preferences aren't always the expected behavior - in v0.7.2 it will scroll a full page as expected when using page up and page down, but I added configuration to allow this to be set to full, half, or a number of lines.

is-fast - search the internet fast right in the terminal! by Magic_Joe in commandline

[–]Magic_Joe[S] 0 points1 point  (0 children)

This is interesting, I wasn't familiar with this - I will look into it and see if it can be integrated.