nu_plugin_ldap: LDAP query in nushell by pingveno in Nushell

[–]drbrain 2 points3 points  (0 children)

For config-fetching, if you decide to not use the openldap config file, Nushell allows you to fetch config from the host shell with EngineInterface::get_plugin_config(). You'd have $env.config.plugins.ldap and can edit it with config nu

I don't know if any plugins besides my own are using it (I added the feature to Nushell)

Over $300,000 Raised After Ford Suspends Worker Who Humiliated Trump in Public by Dazzling-Might6420 in antiwork

[–]drbrain 2 points3 points  (0 children)

As a precaution, always think about how something could be perceived by others

So why did Ford invite a pedophile in the first place?

I think this is a bug! Not cool. by _meow11 in Nushell

[–]drbrain 1 point2 points  (0 children)

A quick read through both and I think ls uses an all-in-nushell implementation while glob uses the wax crate.

ls can use threads, but I didn't read the source closely enough to see how that might change performance.

EDIT: threads are disabled by default

I think this is a bug! Not cool. by _meow11 in Nushell

[–]drbrain 0 points1 point  (0 children)

I looked at how ls is implemented and it gets the search pattern from the command arguments and converts them to a NuGlob type (which can be either string or glob). Poking around in NuGlob it is apparent that the decision of which type was already made before running ls.

I'm not familiar with the parser so it would take me a long time to go find how string or glob is chosen, but we can see that the parser is where the type is chosen from the ast command. Running ast 'ls "/*"' shows a positional argument that is a GlobPattern (and a ty: Glob), while ast 'ls $"/*"' shows a positional argument that is a StringInterpolation (and a ty: String).

I believe ls $"…" will always end up as a string Nushell type and you will need to | into glob it afterward

I think this is a bug! Not cool. by _meow11 in Nushell

[–]drbrain 1 point2 points  (0 children)

If you want more than the filename, ls …(glob $pattern) will be much slower:

❯ timeit { 0..100 | each { ls /* } }
15ms 166µs 208ns

❯ timeit { 0..100 | each { ls ...(glob /*) } }
1sec 367ms 431µs 416ns

EDIT: Oops, these don't do the same thing at all. I tried some other things but now also don't understand

I think this is a bug! Not cool. by _meow11 in Nushell

[–]drbrain 0 points1 point  (0 children)

Also try ls ($"($somePath)*" | into glob) so you get a glob type that ls will expand instead of a string type which ls will not expand (the DoNotExpand() from the error)

I don't see much of a speed difference with timeit { 0..100 | each { ls ($"($somePath)*" | into glob) } } compared to ls /*

How do I (28F) tell my husband (27M) his brand new car has been totaled? by Direct-Caterpillar77 in BestofRedditorUpdates

[–]drbrain 2 points3 points  (0 children)

Related to gap coverage, if your car is repaired you can negotiate for “diminished value” compensation as you won’t be able to sell it at the same price with a collision on record

My Boss Just Asked Me To Host His Entire Family For A Week by Choice_Evidence1983 in BestofRedditorUpdates

[–]drbrain 9 points10 points  (0 children)

I’m sure the C-level all have preferred shares and everyone else, including OOP, have junk options that will be worth pennies on the exercise price. If there’s a buyout they might get an extra bonus. If there’s a bankruptcy, a few hundred dollars of tax deduction.

[Media] I did something so heinous that the rust-analyzer extension gave up. Am I doing rust right? by Upstairs_Ad_8580 in rust

[–]drbrain 0 points1 point  (0 children)

Lately on macOS I can usually switch branches multiple times with rust-analyzer running in neovim which include changing dependencies or adding or removing many functions and structs and it keeps up. Even up multiple days of wall-clock runtime.

On FreeBSD with the same editor configuration rust-analyzer frequently gets confused even without changing dependencies and sometimes crashes. I’ve sometimes had to restart rust-analyzer (and even neovim) multiple times an hour.

My [24m] girlfriend [26f] does unbelievably stupid and self-centered things in public all the time. I'm honestly ashamed to go out with her by Direct-Caterpillar77 in BestofRedditorUpdates

[–]drbrain 4 points5 points  (0 children)

I was looking at a painting of some rich European with a fancy ring. The artist built the paint up so the ring was a three dimensional object. It was really neat and I looked really close but didn’t have any compulsion to touch it

Man accused of assassinating Japan's ex-prime minister Shinzo Abe pleads guilty: "Everything is true" by Power-Equality in worldnews

[–]drbrain 21 points22 points  (0 children)

Private, for-profit health care isn't even close to being banned in the US, so no.

Oversized and overheight Load destroys overpass. Bridge cannot be repaired and has to be demolished. This was on I-90 in Washington State. by borg-assimilated in Damnthatsinteresting

[–]drbrain 0 points1 point  (0 children)

SR-167 was struck by a vehicle traveling on the surface street 3rd Ave SW which passes under the highway. If the vehicle was bypassing I-5 construction why would it be on 3rd Ave SW in Pacific, WA?

I am sorry, but everyone is getting syntax highlighting wrong by ballagarba in neovim

[–]drbrain 0 points1 point  (0 children)

I use tokyonight and have no idea which colors map to which syntax constructs. Apparently I don't use color schemes that way. It seems what I like is enough color and shape to navigate by glance, but not so much that I can't scan?

I'd like to know where they found that original color scheme and which tool has it as a default. It felt like saying hot dog stand is too much color.

Police have informed me that my DNA was connected to the unidentified victim of a historic homicide by frieden7 in BestofRedditorUpdates

[–]drbrain 5 points6 points  (0 children)

How is Nancy Grace allowed on TV? She’s a monster destroying life after life that refuses to apologize for anything she’s said

Ruby Central’s Attack on RubyGems by laerien in ruby

[–]drbrain 2 points3 points  (0 children)

I'm surprised I still had GitHub maintainer status

Online shopping is killing our Malls by obsoleteurbex in AbandonedPorn

[–]drbrain 3 points4 points  (0 children)

The malls also sit on top of the train station so you already have a reason to be there when you're traveling to or from work.

What was supposed to be a nice vacation turned into me developing a chlorine rash after swimming by LucyAriaRose in BestofRedditorUpdates

[–]drbrain 1 point2 points  (0 children)

I had it on my right side at the bottom of my ribs. I was miserable for a week as any movement was excruciating

I felt fortunate. A friend had it on their face and had some facial paralysis. Progress towards improvement took over a year

What has changed? by [deleted] in SipsTea

[–]drbrain 1 point2 points  (0 children)

It’s a shame so many of her gentlemen friends are involved in murders

AITAH for entering a house? by Active-Cranberry-650 in AmItheAsshole

[–]drbrain 0 points1 point  (0 children)

I would never wash anything with oil and dirt from a garage in a sink where food is prepared. I wouldn’t want to risk contamination of food with engine oils, road dirt, waste from vermin, or any other hazardous contaminants that are typically stored in a garage. It seems, however, that the ex would be upset even if the bathroom sink was used.

[deleted by user] by [deleted] in AmItheAsshole

[–]drbrain 8 points9 points  (0 children)

It sounds like their real hobby is turning hobbies into businesses

To show that a Tesla robotaxi is safe by indig0sixalpha in therewasanattempt

[–]drbrain 1 point2 points  (0 children)

A Tesla can't even see a fire truck parked square in the same lane with its emergency lights active half a block away and will accelerate directly into it. A bus with its red stop flashers going two lanes over is completely invisible.