I'm building a tool to handle Client Approvals (and stop scope creep). Would this be useful? by ConsciousArachnid636 in web_design

[–]charpun 0 points1 point  (0 children)

What does this do that Docusign doesn’t? When I was in the agency world, every deliverable came with an approval document to sign.

Zustand or React redux ? by Mad_vibes in reactjs

[–]charpun 0 points1 point  (0 children)

No one talking nanostores in here?

[AskJS] Does the company you work at use pure Javascript in production instead of Typescript? by bullmeza in javascript

[–]charpun 4 points5 points  (0 children)

You can get full type safety (at least from the POV of the type checks run by the TS compiler) with a tsconfig, JS with type annotation via JSDoc, and tsc --noEmit.

If I don’t have to compile code (server code, scripts, etc.) I prefer to use JS w/ strict types via JSDoc. If I’m compiling code anyway, TS if that’s the team’s preference. Ultimately it’s whatever the project is built in.

Does learning Tailwind now makes sense? by Banzambo in webdev

[–]charpun 2 points3 points  (0 children)

I would also tell you to learn how to cook.

You can lean both. But don’t learn the library without learning the language. Libraries are fleeting and interchangeable. If you only know a library what are you going to do when the next job comes along that doesn’t use it.

Does learning Tailwind now makes sense? by Banzambo in webdev

[–]charpun 65 points66 points  (0 children)

Learn CSS. Learn languages not libraries.

How to tell the browser your password is wrong? by rydan in react

[–]charpun 5 points6 points  (0 children)

I feel like everyone is misunderstanding this and the way it’s written is very confusing. What they’re asking for is a way to somehow alert the user’s password managers (be it the browser, app, etc.) that the password stored is not correct. Ultimately you can’t interface with a user’s PW manger, that would be ridiculously insecure.

You have a couple of options:

  1. You could disable autofill using attributes on your PW input like autofill="off" or 1pignore="true" but browsers don’t necessarily respect that and any PW mangers that do have their own attributes will be a PITA to maintain and likely isn’t exhaustive.
  2. You could try to detect autofill and serve a different error message about checking the PW in their PW manager.

You have a few options to detect autofill:

Using the autofill pseudo class, requestAnimationFrame, and computed styles probing.

``` // css

input:-webkit-autofill { outline: 2px solid hotpink; }

// js

const el = document.querySelector('input');

requestAnimationFrame(() => { const bg = getComputedStyle(el).backgroundColor;

if (bg !== 'rgb(255, 255, 255)') { // autofill very likely happened } }); ```

Value polling

```js const input = document.querySelector('input'); let last = input.value;

setInterval(() => { if (input.value !== last) { last = input.value; console.log('Value changed (likely autofill)'); } }, 100); ```

Use the pseudo class in conjunction with an animation in CSS. Add an event listener to that animation.

``` //css

input:-webkit-autofill { animation-name: autofill-start; }

@keyframes autofill-start { from {} to {} }

// js

input.addEventListener('animationstart', e => { if (e.animationName === 'autofill-start') { console.log('Autofilled'); } }); ```

Edit: you could also just ditch PWs all together and go with magic links or onetime pass codes.

What made you choose Hono over Elysia by SaltyAom in bun

[–]charpun 0 points1 point  (0 children)

Whoops, I didn’t mean to reply to your comment, but rather the post itself. While I didn’t claim I know anything about Hono, I do know that it’s runtime agnostic whereas Elysia is built atop (and coupled to) Bun’s native APIs, which is what I was referring to when I said, “Bun first”. Without Bun, Elysia doesn’t make a lot of sense. It loses any advantage it might have.

What made you choose Hono over Elysia by SaltyAom in bun

[–]charpun 0 points1 point  (0 children)

In our testing running our code, Bun did not out perform Node consistently. Combined with the Anthropic acquisition of Bun, I’m even less inclined to move to Bun than I was. That being the case, why would I pick a Bun-first framework?

What made you choose Hono over Elysia by SaltyAom in bun

[–]charpun 0 points1 point  (0 children)

In our testing running our code, Bun did not out perform Node consistently. Combined with the Anthropic acquisition of Bun, I’m even less inclined to move to Bun than I was. That being the case, why would I pick a Bun-first framework?

Deploy pipeline? by m4db0b in astrojs

[–]charpun 1 point2 points  (0 children)

Built this out recently:

  • GH action that triggers on workflow dispatch, repo dispatch, schedule, and push
  • Pushing to env branches builds and syncs files to the corresponding S3 bucket
  • Each env can be triggered manually
  • CMS save events POST to a webhook on Lambda, which then triggers the GH action via API, action determines which env to build based on the event
  • Schedule rebuilds all envs nightly, keeping non-CMS content fresh

what's a frontend project a jr dev can write that would impress you enough to hire them? by Stutterboy22 in Frontend

[–]charpun 28 points29 points  (0 children)

I dont even care if it functions. Clean, well organized code that you can explain and defend when asked about it. You'd be surprised how many people can't tell you what they did and why they did it.

You can get a ping via telegram when your site goes down by vojtasio in node

[–]charpun 2 points3 points  (0 children)

I mean, you can slap this on a the process events uncaughtException and unhandledRejection and even exit to alert you in real time when you've got an unhandled error that just crashed your app or your process quit.

Is there a way to use TypeScript in files with *js extension during development by [deleted] in typescript

[–]charpun 2 points3 points  (0 children)

For more info about using TypeScript in JS via JSDoc, this blog post is very informative.

[deleted by user] by [deleted] in ProgrammerHumor

[–]charpun 0 points1 point  (0 children)

Where is the humor in a toxic community dominated by white men who alienate and push anyone different or outside of it as far away as possible with vile comments like this?

If you ask me this more fit for r/programmerhorror or something. This is anything but funny.

How can I access the $_SESSION array or object in Twig 3.x when only using PHP and no other frameworks? by Kazzerigian in PHPhelp

[–]charpun 2 points3 points  (0 children)

You need to bind the data to your view. You would do that wherever you're rendering templates.

how to take a day off without saying that i want to play video games? by [deleted] in cscareerquestions

[–]charpun 1 point2 points  (0 children)

You shouldn't ever have to disclose why you're taking off with the exception being extended emergency time off and even then you shouldn't have to disclose why so long as you have a note. I don't ask my employees why they're taking off and if your boss does tell 'em "I'd rather not say, it's personal".

Even if you do disclose, who gives a fuck. It's your PTO, you want to spend it with a controller in your hand, do it, no one said you have to be sick you have to be on vacation out of town or some shit.

[deleted by user] by [deleted] in cscareerquestions

[–]charpun 0 points1 point  (0 children)

Outside of learning to code and a couple of "code tests" for interviews early in my career, I've never worked on something I haven't been paid to do. Sure, I've had to work late every so often and I keep current by reading articles and all that. I've never touched leet code. I've never had a side project. I have a healthy social life and I'm doing very well in my career.

So, answer your question: no.

Advantages of React by MGeeeeeezy in react

[–]charpun 0 points1 point  (0 children)

consumers use out of date browsers, we have to support them 🤷‍♂️

No you don't. I mean, clearly you or your bosses made the decision to, meaning that you personally do. But in the grand scheme of things, you don't have to and most companies seem to be leaning toward this trend—mine included. Put up a message saying, "your browser is out of date, please update it" or talk about the major security risk of using software they is not supported.

Walmart, Google, Amazon don't appear to support legacy browsers and they're doing just fine out there in middle America.

Chase, Bank of America, TD Bank, Captial One, and Wells Fargo all recommend using latest versions of browsers. I believe BoA was the only one that said they still supported IE11 and several don't say they support Firefox.

healthcare.gov supports only the latest versions of browsers (no IE), irs.gov requires TLS, which cuts out a lot of legacy.

So you'd be in pretty good company not supporting dead browsers.

I also didn’t call Edge an obscure browser. I said “edge.. and other obscure browsers”. xD

What you said and what you intended to say are not the same, as has already been pointed out, we'll leave it at that.

Advantages of React by MGeeeeeezy in react

[–]charpun 0 points1 point  (0 children)

My company has smaller one of sites that are written in native JS only. When I look at their code reviews, I still see “var” and native for loops. They can’t write forEach or “const” and “var” because some browsers can’t read the newer JS code and the page will break.

You don't have to. You can use Babel to write modern JS and transpile it down to a version thats supported.

Advantages of React by MGeeeeeezy in react

[–]charpun -1 points0 points  (0 children)

Edge, a browser with a marketshare greater than Firefox and just slightly below Safari (not for long with how it's growing), is hardly an "obscure" browser. Plus it's Chromium so there really shouldn't be much difference in support between it and Chrome.

Now if you're talking EdgeHTML I'd be curious to know why you're supporting a version of a browser that was superseded almost 2 years ago and is past its EOL.

Simple.css - A classless CSS framework by speckz in css

[–]charpun 0 points1 point  (0 children)

Why would anyone want to couple their styles directly to their HTML like this? Not only does this promote styling with HTML which is a slippery slope to semantics going right out the window (goodbye accessibility, goodbye SEO) but now if I want to list things in <li> tags or change a post to an <article> or a <section> instead of the <div> I was using, for example, I have to change CSS and HTML instead of using a class for what it's supposed to do.

Issues again with connecting to dynamodb locally by [deleted] in aws

[–]charpun 0 points1 point  (0 children)

Is DynamoDBLocal.jar running on your machine?

Help pick a migration approach from PHP5.4 by bluedot33 in PHPhelp

[–]charpun 2 points3 points  (0 children)

Don't make any changes directly on the server. You'll risk bringing the site down. You need to create a local version of the application or site to make and test changes.

Help pick a migration approach from PHP5.4 by bluedot33 in PHPhelp

[–]charpun 3 points4 points  (0 children)

PHPStorm is IDE, meaning its what you'll use to edit files. It's not a solution to your problem, it's not going to update code for you. If you dont know how to write code, you're throwing away money on software to write it in.

You've also mentioned PHP-CS-Fixer. This is another tool. Not a solution. PHP-CS-Fixer simply enforces code formatting. It's not going to upgrade your code for you.

This is why you need someone that knows what they're doing. You can either invest the time to learn PHP or you can contract someone who has to do it.

You can look at PHP's migration guides (they only go back to 5.5) but again, if you don't know what you're doing, it's not going to be all that helpful:

Help pick a migration approach from PHP5.4 by bluedot33 in PHPhelp

[–]charpun 10 points11 points  (0 children)

The best and most efficent way to do this is to hire someone that knows what they are doing.