kb0

yo! // software lead 🎮

hello, and welcome to my odd little chunk of the net!
日本語中級
(glad I could be here o7)

posts from @kb0 tagged #tech

also:

> "a clean local is a happy remote."
- erwin schrödinger

yo cohort crew! it's a rare sunny day up here where I am, so it's time.

time for what?
coming in hot with a useful curated bash query, that is!

you could've googled this, but who cares? I have it saved in my Archive of Useful Code™.

have you ever wanted to clean up all 132 of those already-merged git branches you have in your uber-large project? I sure have, and so I set off on an adventure to find a command to do it. and I did! here it is:

git branch --merged | egrep -v "(^\*|main|dev)" | xargs git branch -d
Note: replace the egrep branch name expression after ^\*| with branches you want to keep. you can see I have main and dev ignored, since I don't want them deleted by this.

(if you're good, good! if you want to know more, keep reading!)
> so... what does the expression mean?
the pattern given to egrep is a regular expression (nice guide here). this specific one will match any of
  • a single asterisk, *
  • the word main
  • the word dev
see this regex101 example for an interactive demo. the asterisk is required to ignore the branch you're currently on . . . don't want to delete that out from under yourself.

as for the egrep command itself, egrep is just grep -E, for selecting expressions from a list of inputs. the -v flag means to select all expressions that don't match the supplied pattern regex, which means the above three will be ignored.

this means all branch names that are not those will get passed as an argument list to git branch -d, which naturally deletes the given branch(es).

and that's it! make sure to get outside and get some fresh air amidst all those wacky side projects you have . . . that I also have a lot of . . . I'll be sure to! 😎

> -kb0


> yo!
good evening cohost crew! it's ya boy
> kano
coming in for the long haul!
spent a bunch of time at various big techs, but prefer working on what I love most.
my deep technical background is in all things web, data engineering, cloud/platform & computer architectures, and progLs -- and driving teams to be their healthiest + bestest doing it.
on the side, I produce music (since 2018)! I focus on "essence", which tl;dr is layered melodic sound design that flutters up high and booms down low.
> highlights:
- too many to list tbh, did X projects and have saved stacks $Ym + Z time
- next.js ftw
- edge AI/CV src -> Rust ingest via k8s
  -> data lake -> semantic layer
  -> website (you!)
- Δ ???

otherwise: I play games (variety!), fly virtual jets, watch anime, support my idols, ball out with friends, and live my best life!

I hoped to post about various tech topics and random things I learned while solving super simple or super complex quests on my grand campaign to learn and grow, because
1) curiosity is best captured in stories, and
2) it may help the odd fellow traveler of these distant, unexplored lands. probably. maybe.

but it's okay that I didn't! I was so busy with life and projects to generate material for this, that it became too late... at least for this site >:D (see if you can find me somewhere!)

that code block looks like a top 😌