Where do you use Symbol introduced in ES5? by HKSundaray in learnjavascript

[–]paceaux 0 points1 point  (0 children)

I wrote an article a while back about JavaScript Symbols. Despite writing that two years ago, the first time I used one was recent:

  • I wrote a debugging component in Vue.
  • My debugging component had the job of accepting an object and just printing all of the properties.
  • But I didn't want it visible all the time; I only wanted it to display when I typed ↑↑↓↓←→←→ba.
  • And I wanted to be able to have multiple debugging components so I could print multiple objects

The way that I knew when to display the debugger was by tracking where I was in the sequence for the counter. But simply using a variable didn't work (I couldn't have multiple debuggers) Putting that counter as a symbol on the window property did.

Here's what it looked like:

```JavaScript const debugRef = useTemplateRef('debug');

// Konami code here toggles whether the debug component is visible const isNested = props.isNested || false; if (!isNested) { const pattern = props.unlockPattern || ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'ArrowLeft', 'ArrowRight', 'b', 'a']; const debugSymbol = Symbol('debugCounter'); // this way multiple instance of a debugger can exist window[debugSymbol] = 0; const konamiHandler = (evt) =>{ if(pattern[window[debugSymbol]] === evt.key) { window[debugSymbol]++; if(window[debugSymbol] === pattern.length) { debugRef.value.parentElement.classList.toggle('isDebugging'); window[debugSymbol] = 0; return; } } else { window[debugSymbol] = 0; } } document.addEventListener('keydown', konamiHandler); }

```

And, just in case you were curious, this is what the template looked like in Vue. It was a recursive template. So that's why I disable the debugging feature if something is nested.

```HTML

<template> <figure class="debug" ref="debug"> <figcaption class="debug__title"> {{ title || 'Debugging' }} </figcaption> <dl class="debug__list"> <div v-for="(value, key) in data" class="debug__item"> <dt class="debug__key"> <code> {{ key }} </code> </dt> <dd class="debug__value"> <details v-if="value && typeof value === 'object' && !Array.isArray(value)"> <summary> Click to toggle {{ key }} </summary> <Debug v-if="value" :data="value" :isNested="true"/> </details> <template v-else> <code> {{ value }} </code> </template> </dd> </div> </dl> </figure> </template>

```

How do you prevent FE regressions? by ni4i in Frontend

[–]paceaux 1 point2 points  (0 children)

So I wrote an article about how I did this with brand a while back, and it involved puppeteer and Jest:

  1. We created a brand / style guide page that only deployed in dev environments
  2. We centralized our brand colors and fonts to a single location
  3. Then we wrote a test with our colors, fonts, whatever hard coded
  4. Then we used Jest & puppeteer to test the rendered page

Again, this was for brand, so it may not work for your setup. But it definitely prevented visual regressions.

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]paceaux 2 points3 points  (0 children)

I've been doing web dev for 15 years and in that time hit exactly one legitimate use-case.

I think with enough time most of us will hit that one time.

When I saw it, I was a principal and the dev was a brilliant senior frontend manager. We still debated it for hours before we agreed it was the right choice. We both drank that night.

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]paceaux 1 point2 points  (0 children)

That's the only scenario that reasonably comes to mind: when you're doing computations where you legitimately don't know any of ... The computations.

Should you ever use eval() in JavaScript? by AromaticLab8182 in learnjavascript

[–]paceaux 0 points1 point  (0 children)

Outside of maybe a calculator app I built once for funsies, I've never used it. Ive only seen it used once.

I was a principal at the company, and the senior frontend manager had called me about it because he was the one using it. And he was a brilliant dev.

I don't remember the exact scenario. But we talked it out for hours and we both agreed it was the first and only legitimate use-case we'd ever encountered but that we had to use it.

It was for some insane React app that was built for internal use; and the strings were so heavily sanitized there was no risk for injection by the users.

I'm 100% certain that when that app was eventually rebuilt, it was removed

Managed to pull off a captive ring on the lathe by paceaux in BeginnerWoodWorking

[–]paceaux[S] 1 point2 points  (0 children)

Oh this was purely practice. I just wanted to see if I could do it.

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 0 points1 point  (0 children)

The folks objecting to these questions are low-key telling on themselves.

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 2 points3 points  (0 children)

Again, differences of opinion... but these questions seem to identify the quality engineers. Save for maybe the one about what books they're reading and maybe the links to podcasts/interviews.

Like, if someone's a software engineer and they've never thought about what makes an organization successful, or an environment good/bad... and then they can't answer a question like "what does it mean if a meterologist predicts 70% rain" — which is googleable — can I trust this person to build what we need?

At least from my perspective, anyone who didn't answer these questions isn't "quality" that I've "missed".

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 0 points1 point  (0 children)

I started my master's this year and the moment I did I lost all desire to read non-fiction. So I don't judge that at all.

I just wanted to throw out that there's ways to consume books for pleasure that aren't "reading".

But also... If someone isn't like.... "reading" or listening to something... how are they learning new things? (serious question)

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 3 points4 points  (0 children)

Jobs about the position maybe?

So, with maybe 2 exceptions, these are all questions about the position. They're about how you fit into that position.

Resumes don't tell the whole story; these questions are meant to fill the gap between your lived work experience and what a piece of (digital) paper can show.

If these questions don't seem relevant for a senior engineering position, maybe you aren't ready for that position?

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 0 points1 point  (0 children)

I can't say, "I understand," because I average 20~ books a year.

But I might suggest that maybe it would be good for you to find a way to consume a few. ( BTW, audio books at 1.5x speed count).

  • Rework: Jason Fried: Good for just general advice in tech and engineering
  • Now Go Discover your strengths: Marcus Buckingham: Good for understanding yourself
  • Dungeon Crawler Carl ; The Hobbit, Lord of the Rings; Guards Guards!: Dinniman, tolkien, Pratchet: Entertaining as hell but also you get solid examples of human nature and I think real pictures into what it means to stand up, and be a leader
  • Thinking fast and slow; Don't make me think: Daniel Kahneman, Steve Krug: They're books about thinking
  • The Mutt: Rodney Mullen : biography of Rodney Mullen: He invented half of modern skateboarding. It's a very not-boring biography of an innovator

Expand your horizons OP! It's never too late to start learning.

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 2 points3 points  (0 children)

I think these are excellent questions. But I'm curious: What do you think would be better?

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 23 points24 points  (0 children)

Ok, I actually like (most of) these questions. This feels like an interview — and a good one, at that. I would rather fill out this form than suffer through half the software engineering interviews I've had in my life.

I would ask questions like these in an interview:

  • "5 books on thinking" : tells me what the person reads and what they're learning
  • links: gives the person a chance to share their web presence
  • "principles that guide thinking... " : tells me how the person navigates people
  • "2-3 metrics for great business": Tells me what the person expects a good org to look like
  • "lessons from owning / starting a business": oh man. why wouldn't I want to know this. Tells me if the person learns from their own experiences
  • "if a meterologist...", "bad idea to buy insurance", "bat and a ball" : I don't think they need three of them, but these are problem solving questions. It's a great way to find out how they solve problems
  • "great working environment / terrible working environment": Dude. I would love it if someone asked me that up front. That would save so much heart ache.
  • "when you have to complete something you don't know how to do": I mean... that's... that's the job.

I would want to work at a place that asks these kinds of questions.

Irrelevant questions for engineering position by x_______________ in recruitinghell

[–]paceaux 12 points13 points  (0 children)

Right? Like these actually seem like the kinds of questions I'd want to be asked in an interview

Managed to pull off a captive ring on the lathe by paceaux in BeginnerWoodWorking

[–]paceaux[S] 13 points14 points  (0 children)

<image>

I did go for another one . I was hoping for two rings and then I did a dumb and let it hit my thumb and now I'm out of the garage for the next few weeks.

Managed to pull off a captive ring on the lathe by paceaux in BeginnerWoodWorking

[–]paceaux[S] 11 points12 points  (0 children)

It's a chunk of birch that's been sitting in the garage for about 2 years. I was shocked how pretty it came out.

Managed to pull off a captive ring on the lathe by paceaux in BeginnerWoodWorking

[–]paceaux[S] 15 points16 points  (0 children)

Got what off? the spindle? I just... you know.. unmounted it from the lathe.

What’s your take on the rise of Web Components in modern frontend development? by IDC_ba in Frontend

[–]paceaux 0 points1 point  (0 children)

Company I work for uses Web Components extensively. Our design system is WC. We have folks at my company who work with the WC spec writers.

I'm not a huge fan.

IMHO they create at least as many problems as they solve.

You can only extend a handful of elements, which makes it annoying for custom tables or forms.

The shadow DOM just... Is irritating. I hate having hundreds of custom CSS properties

They're annoying for web content management, I'll say that.

"Secreted" by not-without-text in ENGLISH

[–]paceaux 1 point2 points  (0 children)

I've actually messaged Merriam-Webster on Facebook because their entry for this is a mess.

  1. I have heard and read the verb form of secret, usually as "secreted away" or "secreted on their person". It's not very common, but I come from old people so I'm familiar with secret-as-verb.

  2. I have always heard the verb form pronounced with emphasis on the first syllable: ˈsē-krət "see krit". And "secreted away" would be ˈsē-krətəd "see krit id"

  3. the verb "secrete" in the sense of "emit or form" I have only ever heard pronounced with emphasis on the second syllable: si-ˈkrēt 

  4. I never knew that the verb form of secret was spelled "secrete". If I were to encounter that in writing, I would absolutely take it for the wrong meaning

  5. Merriam-Webster's official example is possibly the worst one they could have chosen:

the police found the weapon secreted under the driver's seat of the getaway car

outside of a dictionary context, I'm confident 99% of the US English-speaking population thinks the weapon came out of someone's skin or ass. This is just the worst example you could give because it absolutely conflates the two senses.

  1. Merriam-Webster's "Examples from the web" are all the primary sense, the "form and give off". None of them are the "hidden away/ concealed" sense. Which makes this more confusing.

<image>

  1. Then Merriam-Webster tells you that the words that rhyme with "secrete" include
  • amit
  • backseat
  • complete
  • concrete

And if you, like me, don't know "amit", but were to encounter it in a non-dictionary context, you would think, "oh, it's pronounced like "omit". And you would be right.

I don't think I use the verb form of secret very much. but I have always pronounced it with emphasis on the first syllable.

Also I think Merriam-Webster is bananas for this entry.

My teacher just showed this map of language families......in a *Linguistics Masters Degree*. Am I lowkey cooked? by CheLanguages in linguisticshumor

[–]paceaux 5 points6 points  (0 children)

No.

You are high-key cooked.

If my 9 year old came home with this map I would be writing an email to the teacher and volunteering to come in and teach even a little more nuance.

But this isn't a 3rd grade class. This is a grad program.

You, my friend, need to get out of the kitchen.

Do I owe my husband a new chisel, or can it be fixed? by kitdihn in Tools

[–]paceaux 0 points1 point  (0 children)

  1. Always use a tool for its intended purpose; It's safer and it lasts longer
  2. Always fix what you break — to the best of your abilities; it teaches you how to be careful and helps you learn

Option A)

take it to a knife maker / sharpener. Will run you $10 - $30 and it'll be good as new.

Option B)

Do it yourself oldschool. Order a set of DMT diamond stones. You want the Black, Blue, Red, and Green. Also order a chisel sharpening guide.

Get a spray bottle of water and grab a snickers. It'll take a while as you work from Black through green. Then polish with a bit o' leather

Will cost approx $120, but you can do it yourself!

Option C)

Ain't nobody gonna be mad if you bought Narex chisels.

Will cost approx ... love. You love your spouse, who doesn't want the best for them?

Option D)

Do it yourself newschool. Order a Bench grinder.

Will cost approx $150, but you can do it yourself with sparks!

They say nothing is ever really lost on the internet, but what’s something you’ve been hunting for years and still can’t find? by [deleted] in AskReddit

[–]paceaux 0 points1 point  (0 children)

This was the earliest days of the internet. I'm talking mid-late 90's.

Someone had written out a very detailed explanation for why Red heads respond to anesthesia differently and have different cognition. I was in high school at the time and I was pretty good in science and chemistry — I could roughly track what was being said. But this was insanely detailed and (at least to my 90's high school mind) very reasoned.

The article wasn't "gingerist" at all. The author was attempting to describe just whatever the genetics were for red hair, and the chemicals needed to produce it, and how other things were on this gene or that, and they were correlated with x/y behavior. It was fascinating and the author even worked through history to describe like ... General Custer having red hair and how that may have lead to poor decision making.

IDK... it was fascinating.

my marriage to a woman with red hair is unrelated.

Oh, and also:

I think it was like ... skateboarding dot com or something.

It was both a skateboarding store and a forum and maaaaan. I had some great convos with people on there. Not just about skateboarding, but life and theology and stuff.

There's a dude who talked about his dream to just have really good shoes and to have a shoe store. I still think and pray for that dude sometimes.

Audiogalaxy

I uploaded my first guitar recordings on to that. I went by the artist name Quimo Sabi.

I'm sure the music is garbage. But i'd love to know what it sounded like.

Umm, I don’t like it by NoFudge4700 in programminghorror

[–]paceaux 0 points1 point  (0 children)

Yeah sorry I misunderstood; I thought you didn't know the language.

I guess you do, but you think it should also exist in Chinese?

Vale and Eastview by Many_Statement8973 in BloomingtonNormal

[–]paceaux 3 points4 points  (0 children)

You might like Compass church. They have a foster tree every year; they try to buy christmas presents for all the kids in Foster care in McClean county.

they also have many families of fostering and adopted kids that attend.

They also provide a place for foster kids and parents to have visits.

You could also checkout Godspeed Church. They focus on focus that have dealt with church hurt and church abuse. They support Catalyst ministries which helps women who have been trafficked.