🌈 grepc 1.3.0: more features, more problems

Estimated Reading Time: 3 minutes

Well, well, well… if it’s not another release notes? Looks like I finally had enough changes to justify a release.

But wait, we were on the front page of VS Code Marketplace!

AND WE HIT 15,000 INSTALLS!

Thank you all for supporting this project :). I can’t express how grateful I am that so many people choose to use this extension.

So what’s new in this release?

New Features

Before and After attachments!

Edit / Import Mode!

Export Rules to JSON!

Debug Mode!

Look at that cute little checkbox. (No one is going to use this feature besides me…)

Metrics

I wanted to start publishing some of the metrics that are part of having a VS Code Extension as I find this to be quite intriguing. VS Marketplace provides developers with a small but interesting set of tools to see how their extension is being adopted.

As you can see in the graph above, we had a major boost in page views (the line) since being feature on the front page of the marketplace. Our acquisition has also significantly increased since that day with 200~ installs a day.

We did receive a rather unusual spike of 14k installs on one day in particular. I am not quite sure what caused this traffic (botting, extension pack, someone installing it across company). Regardless, it is a warm welcome.

Full Release Notes

Notes

  • With the advent of VSC 1.92+, to drag and drop between webviews you must hold shift.

Added

  • Introduced 3 new minimize commands: All, local, and global.
  • Added debug setting for showing rule states.
  • Introduce before and after decoration states with corresponding UX.
  • Introduced new webview actions:
    • Minimize all rules
    • Edit Mode. Raw editing of the rules.
    • Export rules to clipboard

Changed

  • Addressed bug where disabled rules would apply if editing document.
  • Fixed UX bug with occurrence drop down.
  • Fixed broken license badge in release notes view.

Removed

  • Removed all non-contextual commands from context. (i.e. Only create rule from selection appears on right click).and more. As always, see the full changelog below.

grepc – Release Notes v1.2.0

Estimated Reading Time: 3 minutes

Yesterday marked the release of version 1.2.0 for grepc.

This is the biggest update to come to the extension and features a lot of new content and performance improvements. This update includes overhauls of decoration systems resulting in huge performance improvements, multi-editor highlighting, in-line change support, drag-n-drop overhaul and support, and much more. I am very excited to announce this release as it amounts to 2 months of work since the last major release. I think in the future, I’ll push updates more often…

What is grepc? grepc is a free, open-source extension for VS Code that allows advanced highlighting via regular expressions and intuitive interfaces.

I highly recommend checking out the marketplace page if you are unfamiliar with the extension.

I made this extension for my own use and wanted to provide a polished and complete tool for others to use as well. I don’t expect any income from this project, and I will never monetize any aspect of it; I simply want to provide a tool that I have wanted for years in my own workflow to others in hopes it helps people with their day to day. And who doesn’t want more color in their editor?

Check out the new features below or click the link above to easily install. Interested in the GitHub? Click here. Feel free to report issues or contribute if you’re interested.

New Features

Multi-editor support!

Drag & drop to transfer between workspace rules and global rules

drag-transfer

Release Notes!

Walkthrough

Full Release Notes

Added

  • Decoration System Overhaul!
    • Multiple editor support introduced.
    • Significant performance improvements.
    • In-line changes update decorations.
    • Occurrence updates only occur when needed.
    • Context retention is enabled for webviews.
  • Drag n Drop rules from workspace to global and vice versa!
    • It was a struggle to get this working, including some crazy race conditions in TS (see the boolean lock in ruleFactory…)
    • In a later story, we can move this to be a proper mutex lock.
  • Introduced a release notes page that shows on any major or minor update. (Simply type grepc: Show Release Notes to see the update)
  • Introduced a walkthrough for grepc.
  • Added appropriate support for multi-line regex.
  • Added more badges to the README.
  • Introduced prettier and eslint for the codebase.
  • Improved unit tests.

Changed

  • Updated icon for marketplace and README to appropriate 128×128 and larger icon size.
  • Updated displayName to more accurately reflect what extension does.
  • Refactored previous drag n drop to use HTML drag and drop instead of mouse events. Obligatory
    • This took me… a lot of time.

Removed

  • getRulesArray() does not have side effects anymore 🙂

What’s Coming Next?

  • Support adding text before and after a match
  • More context options such as minimizing all rules
  • Support decorating captured groups (this will be a big feature)
  • Import and exporting of rules
  • Bug fixes and more community support

Shout out to @cheljur for their contributions to the project and manual testing.

Shout out to @daeh for reporting issues with the extension.

Interested in contributing? Reach out to @stneveadomi on GitHub and view the source code at the GitHub repository.

Want to help? Share the extension with your friends.

Providing tools for free: grepc

Estimated Reading Time: 2 minutes

Recently, I announced the public release of a new VS Code extension I created called grepc (grep + color).

I figured I would come on here and post about it along with some thoughts.

Grepc (grep + color) is a highly customizable regular expression highlighter for VS Code. This project marks the first official open source project I have released in a more professional setting (outside of mods and various side projects), and although it took a lot more work than I ever expected, I am quite proud of what it has become.

I think my first major realization going into this is the dedication and effort put out by open source creators. Open source is an amazing concept, and yet, I don’t think people realize the time and effort it goes into developing a project from scratch for free and provide it to others. If we take a look at my commit graph on Github, it tells a pretty interesting story.

In terms of days or work, this is quite a lot. But this was often a post work, 2 hour grind for many of these commits. But again, throughout April and May I was working pretty hard on this project. But perhaps this is a simple attention to detail issue.

The idea itself is pretty simple and has been overlapped in coverage from many other extensions. It seems to be that the “go-to” beginner project on VS Code is a text decorator, but no one seems to have piece together the idea of making it modular and customizable.

Everyone loves the “make a text that says blue be blue“, but no one has made a tool to customize it more.

Winning the Lottery in Vegas

Estimated Reading Time: 5 minutes

Accident Report: 2/24/24

It’s fitting to consider the following incident as “winning the lottery” for it has often been the case that earning the winnings of a lottery is likely a bad outcome for you.

On the 24th of February, I was leading a group of friends (two parties of two) with my SO up the route Cookie Monster with plans to continue into the top of Cat in the Hat and summit the Mescalito. My group was with a newer traditional climber while my SO was with a climber new to multi-pitch climbing but could surely handle the feat.

As we rolled up to the climb, my party was the first to climb, and I decided as the most experienced of the party to lead the first pitch to “set the tone” (style, speed, safety). Given I have climbed this route before, I was confident despite having a rupture A4 pulley in my left hand that has been struggling to heal over the past 4 months. The only thing that I did not quite remember was the exact route, but rather than review the beta we had on the climb, I chose to forgo and charge forward.

I quickly racked my gear at the base, tied in, and climbed swiftly upwards along the face of the cliff left of the “obvious” crack system (I quite love usage of obvious in terms of providing route finding information. I strongly encourage this practice to continue throughout all guidebooks, online forums, and verbal directions, especially when the landmark in question is completely obscure.). I figured I would soon join the major dihedral system, but I would take advantage of all the face jugs until then. Roughly 20 feet up, I placed my first piece, a small cam, into a decent pod. A good placement. Another 30 feet would pass before I placed a slotted nut in-between two constricting horns. A creative nut placement that warranted great appreciation from all who witnessed its glory that day. But I soon reached an impasse.

A bulge row extruded itself above me, and the juicy, squeezed jugs had all but disappeared. Above me lay a fault in the row. Weird white baby powder coated a side pull that would prompt for a strong move on my left hand. As I wondered who would bring baby powder up a route, I figured that the reason I haven’t healed my pulley injury yet lied above me, and that I might as well consider a better option to my sides. At this point, the slotted nut was at head height. I quickly pulled up on a jug to see if there were anymore to be found higher up above the bulge. I pressed both feet on a horn roughly the size of a tissue box, when suddenly it happened.

CRASH! The foot broke. Well, fuck that foot anyways. As I remained hanging from my hands, I then traversed left and right looking for better options, slightly bewildered by the sudden crumbling of what I believed was a decent foot and the questionable remarks of my belayer as he dodged a few of the pieces whizzing by him. I then thought about if the rock was dry, despite my incessant checking in fear of the wet rock police. It had been 2 days of dry weather and given this route gets sun, I was quite comfortable in the conditions. Still, it startled me and had me questioning my reasoning.

Given this, I began traversing right, as I figured gaining the prominent feature of the system would be a better idea and slightly easier than the V2 boulder I considered earlier. As I stepped across, I told my belayer that I was looking for an easier option. Precisely and carefully, I traversed several feet to the right along the bottom of the row. I paused as I noticed some succulents I would have to step over, and I remembered a time in which I had drunkenly stepped on a succulent and admired its beauty. To be growing so quaintly in such a dangerous and in-hospital ar –I was falling. My feet hit a bulge 5 feet below me. I felt the rope catch as I began to swing across the rock. I knew that I would likely hit the wall soon so I tucked my head, but I didn’t put my hands behind my head as I was still holding onto the “wall”. I felt my back roll along the rock, and then softly my head hit the rock, and then I opened my eyes. I immediately checked for my belayer, ensuring that he was uninjured from the rock fall that took place. He was fine. I then remembered to check myself. I was fine? I immediately worried about my head, had I given myself another concussion? Was this the start of suffering again? My anxiety from past traumas began to overwhelm me, but then I recalled I barely rolled onto my head. Phew. It would be several hours of reassuring myself I had not re-injured my head, but that is par for the course.

What the hell happened? I was chilling on a foot, enjoying the easy nature of the climbing, checking the feet and holds I was using, and to quote Alex Handhold “climbing like a cat” with a mighty fine jug in my hand. As I looked up and down, I realized that mighty fine jug was still in my right hand. Nice. I peeked inside the entrails of the freshly exposed rock to see, no, the hold was not saturated (it actually was because exactly 2.5 years ago a flood hit this section of rock and everyone knows that on the 4th thursday of February you can’t climb the mescalito unless you grind silica powder into your chalk. You’re the one ruining Red Rocks because you didn’t do enough prep…). I looked down and asked my belayer if my foot broke, and he confirmed that he dodged a few rocks. I was standing on one section of rock along a rail. Presumably, the feet broke causing me to load my handhold, which subsequently also immediately broke.

I didn’t even get the chance to save it. I was just… free falling. At the time of writing, I have been climbing for 7 years, outdoor climbing for 7 years, trad climbing for 4 years with hundreds of pitches under my belt all over the country, a route developer, and overall, I would consider myself a qualified climber to assess rock quality and the safest way to climb a route. And yet, here I was, helpless to the environment at (in?) hand, despite exercising medium caution to the risk and being given a warning sign. I was disturbed. Could I have prepared slightly better with the route beta? Definitely, and this would have prevented the accident. On Mountain Project, almost all the photos indicate just going direct up the fault system. But my memory served me as climbing the left face and then entering the crack system. My memory is right, that is how I did it last time. This is apparently “off-route” and not intended.

What does this mean? I honestly believe, I won the lottery. I have broken off my fair share of rocks, trundled big rocks, taken off feet and hands, but never have I blown all of them while trusting them. I am not quite sure the odds of it, but I am pretty sure that given all my experience and precaution, it has to be pretty insane odds for it to happen. And yet, I also won the conventional lottery analogy. My piece, a slotted nut, held. If the piece blew, I would probably not be writing this. Given the runout, I would have definitely hit the ground. It was only roughly 50 feet up, and I felt confident about my placements and the spacing. I am alive and well.

And yet, I adjust my knobs and dials, and head out back into the wild.

Tricky Code #1

Estimated Reading Time: 2 minutes

Starting this series to describe code blocks that have tricked me at some point. Whether this be syntactic sugar gone bad or my own negligence, I hope to enlighten with these posts.

In the below code, we have a simple while-loop that sets x to the index of the first instance of the integer 5. If it doesn’t find 5, x will equal nums.length. If it does find 5, x will equal the index of 5 in nums.

int x = 0;
int[] nums = {0, 5};

while(x < nums.length && nums[x] != 5)
{
    x++;
}

System.out.println("x = " + x);
            

Given this code, we would expect the program to print “x = 1”.

And this is exactly what happens… but let’s try some other examples.

int x = 0;
int[] nums = {0, 3};

while(x < nums.length && nums[x] != 5)
{
    x++;
}

System.out.println("x = " + x);

Here, the program will not find 5 in the array and print “x = 2”.

Now, let’s say we want to make this code shorter. Let’s move the x++ into the while condition.

int x = 0;
int[] nums = {0, 3};

while(x < nums.length && nums[x++] != 5);

System.out.println("x = " + x);

Note that we moved the post-increment operator into the index operator.

And what do we get when we print this?

“x = 2”

That seems right!
But let’s try another example

int x = 0;
int[] nums = {0, 3, 5};

while(x < nums.length && nums[x++] != 5);

System.out.println("x = " + x);

Here, we would expect the program to print “x = 2”.

BUT it prints “x = 3”

Why is this?

This is because the post increment is in the check! Regardless of if the check is true or false, the increment will occur!

//So basically

while(x < nums.length && nums[x] != 5)
{
    x++;
}

//does not equal

while(x < nums.length && nums[x++] != 5);