Deleting deeply nested node_modules

So, this is really one a quick one-off post of no real major technical achievement, I just had to do it today to get rid of some cruft left by Atom in my home directory, so I figured I’d share it. Mostly so the top post is a technical post, not some sentimental stuff from last year.

NodeJS, you love it, it’s everywhere. Sadly, they have a funky edge case that can occur on windows for really deeply nested dependencies that looks like this:

project/node_modules/dependency/node_modules/dependency/node_modules…

Windows file APIs have a big problem with file paths longer than the path limit (260 chars), it has trouble reading, writing or deleting them. So if we actually cared we would have to do something more involved, but since we want to delete them anyway, let’s just mangle the names.

function short_rename_children ($directory) {
  # 0-9, A-Z
  $name_chars = @(48..57) + @(65..90)
  $len = $name_chars.length

  function recurse {
    param($dir)

    pushd $dir
    $i = 0

    dir -Directory | % {
      $name = ''
      do {
        $name += [char] $name_chars[$i++ % $len]
      } while ([System.IO.Directory]::Exists($name))

      ren $_.Name $name
    }

    dir -Directory | % {
      recurse $_
    }

    popd
  }

  recurse $directory
}

Wait a while, because those directories can get deep, and then just rm -r -force the offending .atom directory or whatever it is you want to kill.

I think I’m gonna start documenting my side-project, so, hopefully more engaging content coming soon.

Letting Go

A requiem for my wasted youth

I don’t often talk about myself, but I think today is a special day when the truth of things should be laid bare. What a treat for you, dear reader! To get a chance to peer behind the curtain and see the sentimental man behind the giant talking head.

I am the great and powerful SMUG.

Alas, it is not so. It’s all an act. I’m still the same shy nerd I’ve always been inside. I’m more outwardly confident these days, and I have this tiny platform and a readership numbering in the dozens, but I’m still that guy deep down.

Today is special, because when I started this post, I had just turned in my resignation today after 11.7980037352215 years working for the same company.

I’ve often (as in constantly) been asked “Why are you still there!?”, and the truth is, I ran out of satisfying answers, so, I’ve decided I won’t celebrate my 12 year work anniversary. I used to say it was the people, but most of the good people left a long time ago. Then I thought it was because they cared about me, but they don’t. There’s a video clip of me in my early 20s floating around where our marketing director Bruno asks me “Why do YOU work for Santander”, and I sheepishly answer, “Because they let me express myself creatively!”.

It is true, I got to express myself all the time, it just didn’t matter to anyone.

Finally, it came.

I was scared

I didn’t want to leave because it’s scary out there, and this place has not prepared me for life on the outside.

Dropping Out

I think a large portion of my insecurities came from my decision to leave school early. It has definitely left me feeling inadequate even though I work with college grads every day, and mentor college students every summer, and I know I don’t have anything to feel inferior about, the little HR recruiting gate-keepers don’t know or care about that shit.

Unfortunately all of the roles I’m currently working on do require a degree in computer science (or related field) to be considered for the role.

Thanks… thanks a lot.

I did it for the money

TL;DR

  • I was 22.
  • The money was too good.
  • The classes were good but not great.
  • The commute sucked.

Incentives work, but not always in the way you expect. When someone says “You can have a full-time salary now, or continue to be underpaid and finish your degree…” that’s an out I would wager few college students would begrudge me for taking. It was short-sighted ultimately, and I have paid the price for that mistake many times over.

Learn from my mistakes kids. Stay in school.

Breaking Things

It’s not all happy memories, and I think no careful accounting of my history with Drive/SC would be complete without owning up to my failures.

That time Ryan and I took down Production (for a few seconds)

This blog is technical right? Well here’s a fun technical annecdote for you. Back in the day, on ye-olde Windows Server 2003+IIS6, if you wanted to swap the version of the .Net framework used by a particular application pool, you had to click through a series of menus and opt-in to the new version. This was before I had learned the peace that comes from embracing the command line.

We were a much smaller company then, so I waltz over to my sysadmin buddy Ryan and the exchange went something like this:

Yo man

Hey Chief

Can you do me a favor?

Sure man whatcha need?

My shit isn’t working. Can you log in to this production box and flip this over to .net 3.5? It’s totally safe.

[ IIS Resets ]

Oh fuck…

Something you kids today with your JSON and your java-beans cool beans might not realize is that the .Net version wasn’t tied to the pool, it was on the site, and when updating the metabase, the site went down… along with all the other applications.

He took the fall for me and it cost him his bonus for the month. My bad bro. My bad.

In case you read this, I’m much more responsible now, but I’m still largely that same developer, running around with no shoes on.

Some things never change.

Other Bad Decisions

I don’t have any fun anecdotes for these. This is my public apology for endorsing Sitecore, failing to deliver NCache properly, shunning WordPress for static pages and writing that god-awful 2000+ line javascript file that is so needlessly complex, simply because I wanted to reinvent all the wheels. You guys, look at all those closures!

I fucked up guys. I’m sorry.

Victories

Interns

  • Oh my beloved interns. So full of wonder and optimism. It has been my sincerest pleasure working with you all, even if it did keep me artificially at the company well past my expiration date. I’m leaving with a heavy heart knowing I won’t be around to see the newest group of you flow in, and that last year’s Bootcamp might have been the last.

Trainees

  • We took call center reps and made them programmers. I literally made men (and a few women) in my image. I am Smug almighty.

Marketing Reconciliation

  • In my autumn years of this place, my greatest joy has been working with my friends over in the Marketing department again. It was nice to finally put down the guns and end the blood-feud that was started so many many years ago. We carried those same animosities around with us as a culture, long after most of the older generation who started the fighting had gone.
  • Amy, Jaime, Brian, it’s been a pleasure.

Shoutouts

  • Shane Battrick – Thanks for always scrutinizing my commits a little harder than everyone elses. It made me better.
  • James Fugitt – Thanks for not listening to my dad. I liked the pay bump.
  • James Hinze – Thanks for challenging me to be a better… everything.
  • Christy Miller, you were awesome. I’m gonna miss you.
  • Amanda Mangelsdorf – No surprise, but if you must have the best, accept no substitutes.
  • Todd Bredhoft / Brian Brooks – These two godly DBAs could replace 100 mere mortals.
  • Tai Anwar – The only PM I ever loved. Gonna miss you BC.
  • Ravi Kant – I’ll miss you most of all bro. ❤

And now for the flames

kidding

I’m trying to turn over a new leaf here, so I’m not going to do some kind of expose on the SC culture, or why I left specifically.

There are people there who are toxic, but I’m not going to rattle off their names. I’m pretty sure they know who they are.

Change Comes Slowly

and sometimes not at all

All-in-all, I don’t have much to show for over a decade of service. After the dust settled, and all the features and bug fixes are tallied, nothing was ever really solved. We just kept doing what we’ve always done, what all companies of sufficient size do. We didn’t get better, or stronger, or faster, we just got bigger. That’s the sad moral of the story: Nobody will change unless they have to.

Purge Yourself

  • If you (like me) are the best, and everyone knows it, and you’re miserable.
  • if you (like me) were insecure about looking elsewhere.
  • If you (like me) think that your company has your best interest at heart, then you clearly don’t understand how business works.
  • If you (like me) think you somehow “owe” the company something, you are perhaps the victim of mental abuse.

You are stagnating.

Take the leap. It’s probably the right choice.

I’m a little sad, but then I remember that we aren’t a family, and we never were. At best we were all just seeking shelter from the same storm, lucky to be alive.

So don’t be like me kids.

Set a timer.

Evict yourself after two years, or sooner if you don’t like the looks of things. There are lots of benefits to doing this, that maybe I’ll expand on someday, but just trust me, you don’t want to rot on the vine.

 

 

Yours Smugly,

Ross

I R Blogger

Here are my notes from my talk at The Iron Yard Dallas

I had a lot of fun over there and if you’re currently walking the lonely road of the self-made developer and need a foothold, check them out. This is not a sponsored post, they are just really cool people.


Welcome to the community

Unscientific Poll

Are you here for:

  1. The money?
  2. The code?
  3. The lulz?

Dunning Kruger

  • The less you know, the more you think you know.
  • Applies to Most .Net developers

Imposter Syndrome

high-achieving individuals who are marked by an inability to internalize their accomplishments and a persistent fear of being exposed as a “fraud”.

What’s next?

After you leave here, what happens?

  • You join the workforce
  • You become a “real” programmer.

Life Long Learning

Graduation isn’t the end

  • “Job Security” means knowing more than can be automated cheaply
  • Having a satisfying career means not just churning out code for others.

Be a Voracious Reader

Programmers stereotypically don’t talk much, but we sure as hell write a lot.

  • /r/programming
  • Ted Dziuba
  • DHH

Recipe: A good time

  • Your Pajamas
  • Flux (for dimming your monitor)
  • A nice glass of your favorite sippable adult beverage
  • bourbon, scotch, brandy, cognac
  • https://github.com/rails/rails

Watch / Listen

  • Handmade Hero
  • This Developers Life

Make Something

  • A resume only gets you past the recruiter.
  • Any portfolio will set you apart from the other candidates.
  • A good portfolio will put you at the top of the list.

Case Study: Shon

Sonic

Write Something

Writers get a nice break in one way, at least: They can treat their mental illnesses every day. – Kurt Vonnegut

Blog For Yourself

  • It proves you have a pulse
  • Practicing keeps you sharp
  • This industry is frustrating

Anyone Can Do It

smugdeveloper.com

  • Like
  • Subscribe
  • Validate Me

Contribute

  • Be a good citizen
  • Get active in the community
  • Submit Issues
  • Learn the culture

OSS

  • Open source software is vital
  • Giving back is easy
  • You might find a mentor
  • You will definitely learn something

Get Involved

Why?

Why does anyone do anything?

  • Gain Confidence
  • Show Your Work
  • Make More Money

Questions?

  • I’m a professional programmer Smug Developer. AMA!

Yours Smugly,

Ross

Smugcast: Awesome slides done quick

I’m feeling very prolific lately! Enjoy nerds!

Fix Your Presentations

A quick walkthrough of my writing and publishing process for everything.

Content vs Presentation

  • Think like a programmer
  • Do not author in the output format

Nerds Like Text

  • It’s searchable
  • It’s Cross Platform
  • No special viewers
  • It’s SMALL
  • IT’S VERSIONABLE ahhhhh

Minimize Friction

  • If you can remove the things that get between your thoughts and your words, you’re gonna have a good time.

MARKDOWN

If you are a programmer who does not use and love markdown, what the fuck mate, get with it.

Not just for slides

Do this for your:

  • Design Docs
  • Blog Entries
  • Meeting Notes

Honorable Mention

  • Org-Mode: A super advanced
  • reStructured Text
  • LaTex

Get the Tools

  • Decent Text Editor (Emacs, Vim, VsCode, Sublime, Atom?)
  • RevealJS
  • Pandoc

Walkthrough

links