proud of this simple solution

im implementing text search on HTML TTRPG logfiles & parsing the HTML to return meant lines meant searches took ~1.5s

it's a CLI tool, so i realized i could just use ag's faster search to make basically a shitty bloom filter & get it down to 1s lines of ruby in vim:      def text(pattern)       matches =
6 line probabilistic filter with the same guarantees as a bloom filter that shaves 1/3 off the search time by using an existing tool without even adding a gem to the project :)
haven't programmed professionally in over 4 years but it's good to remember i still have the brain for it
does this introduce a silent dependency on the_silver_searcher? yes. will i *always* have the_silver_searcher installed on every terminal i use, and expect others to do the same? also yes.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with jess

jess Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @jessfromonline

13 Nov
i let myself believe NFTs were a passing fad, in part b/c just thinking of them drains my soul, but their adoption & advertising boom is a reminder that:

NFTs are a natural instance of capital expanding private property given near-complete enclosure of existing forms of property
marx writes about the tendency of the rate of profit to fall, which oversimplified, explains that investment opportunities inevitably become less profitable for investors over time, creating periodic crisis and forcing capital to constantly open new investment opportunities
one way that capital can create these new opportunities is "enclosure" (as named by rosa luxemburg, also called primitive accumulation)

aka taking resources that were previously not private (typically land, natural resources, etc.) and privatizing them
Read 11 tweets
13 Nov
#nobechdeltest but the fact that the female lead of altered carbon s1 literally does not appear in the 4min official recap of that season except as an offscreen voice in the final 15s to ask the male protag what he'll do about his long-lost love...says a lot about that show lol
she almost definitely has the second most screentime of any character and the fact that they "recapped" the entire season without her uh. hmm? could this perhaps indicate? she was a shallowly written character?
also the only named women to appear on screen in the recap are 1. the obsessive, controlling older sister 2. the sex worker trapped in a digital memoryscape to relive her murder repeatedly

also says. pretty much the same thing. about how this show writes women.
Read 5 tweets
12 Nov
i’ve now spent somewhere around 4 hours on hold & phone calls over the last week trying to fill 1 prescription i ran out of last week
i am currently at the stage of “my insurance company says they have a plan with my name & member ID (a plan i’ve been using for 1.5 years) but there is no active date. ever. there are simply no dates indicating this plan is active or ever has been”
after 30 minutes, i had been on hold for 10 while the person tried to figure out why my plan didnt have an active date

suddenly it booted me back to the main menu except it was the provider menu not customer, so i have to hang up & call back & start again
Read 4 tweets
12 Nov
[goes into a store to buy a single pair of bootcut jeans] [has to physically pull myself away from the flannels multiple times]
say it with me jess: you have enough flannels
the duality of lesbian one reply saying i have enough flannels and another telling
Read 5 tweets
11 Nov
feels good to realize i can still look at 3 lines of ruby, go "that can definitely be done in 1 line of ruby" and do it in one line of ruby
initialize a local variable from an arg, concatenate to that variable by looping an instance variable array, and return it? nah, call reduce on the instance variable array with the arg as the initial value.
that said, took me awhile to figure out what in the hell i was doing here 7 years ago 15 lines of ruby module Nde...
Read 4 tweets
25 Sep
okay watching pitch black / riddick for the first time and ok i’m already obsessed with fry
her referring to a part of the ship like it’s a part of her body (“I can’t get my nose down”) and i’m instantly in love
getting to the end of this movie: still in love with fry thanks
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Thank you for your support!

Follow Us on Twitter!

:(