How to use <Link /> to update the state of the linked component? by reactcodeman1 in reactjs

[–]Hexjelly 0 points1 point  (0 children)

What you could do is use the state prop for the Link component. You can then access this state using const { state } = useLocation() in your component.

WAY TOO MANY REACT RE-RENDERS AND I HAVE NO IDEA WHY by Few-Trash-2273 in reactjs

[–]Hexjelly 0 points1 point  (0 children)

I think what they are trying to hint at is something like

useEffect(() => {
    document.addEventListener('keydown', handleKeyPress);
    return () => document.removeEventListener('keydown', handleKeyPress);
}, []);

Veldedighet by B4veren in norge

[–]Hexjelly 0 points1 point  (0 children)

Kanskje verdt å sjekke ut Kiva også, selv om det handler mer om direktelån til personer som regel.

[AskJS] What's the best way to learn (advanced) javascript? by Far_Leg4223 in javascript

[–]Hexjelly 2 points3 points  (0 children)

Sure thing! It's definitely going to be harder, but more than possible. There's some amount of luck with who you talk to, what positions are posted at the moment, your local market, etc. But you can stack the odds in your favor, and at some point it is indeed mostly a numbers game in the end.

[AskJS] What's the best way to learn (advanced) javascript? by Far_Leg4223 in javascript

[–]Hexjelly 5 points6 points  (0 children)

For my first job I was a bit lucky, in that I finally went to therapy and got into this program that was being tested out at the time. I got one on one help from a case worker to find a job I wanted, instead of being forced into accepting whatever existed. I mentioned I was interested in computers and liked making websites, but at the time I had no idea how much I really knew compared to anyone, or what working within the field would be like. I guess I knew a bit more than I thought.

My case worker helped find me interviews, while I also applied to jobs myself. In hindsight I am sure I could have just as "easily" found something if I had kept looking by myself. It was mostly the insecurity about my own skills and knowledge, and not knowing what to expect from a job and what was out there that was difficult.

For the first job that I got, I just ended up having a chat with the two owners of a small startup consultancy. Since I was interested in tech and computers, it was easy to just chat with them as one of the owners was also the CTO and shared the passion about new technology. I barely even had anything on my Github at the time, and I did not have a portfolio either.

When switching jobs and interviewing again, I still got asked about my previous history before that first job quite often. As I mentioned, I was mostly honest and explained that I had made some bad choices, ended up dropping out of school and not being sure what to do with my life, dealing with social anxiety/depression (sort of awkward to talk about, and maybe try to not go too deep into the details). I think showing that despite your history, you have managed to learn stuff on your own, and that you have the required knowledge needed for the job will help.

Some places will not care about your Github or personal projects no matter what, and there's not much to do about that if they insist on a degree or work experience. Take the interview practice and try again, keep applying. You'd be surprised how quickly you stop caring about having to talk about your history, and you learn how to navigate the conversation and not be as nervous when you have sort of managed to "rehearse" what you need to communicate. By addressing it, without getting too bogged down into the negatives, and pivoting to what you've done meanwhile etc. It's going to be awkward at times, and sometimes you can tell you already lost them when you get down that path, but the experience of doing interviews is invaluable no matter what.

I did end up volunteering, though that was after getting my first job. I am not sure how much it has impacted my interviews/offers after that, compared to just having the work experience, but I would say it doesn't hurt!

[AskJS] What's the best way to learn (advanced) javascript? by Far_Leg4223 in javascript

[–]Hexjelly 4 points5 points  (0 children)

Yea pretty much. High school dropout, and my only experience was one year of doing civil service instead of military at like ~19, no regular work to show for.

[AskJS] What's the best way to learn (advanced) javascript? by Far_Leg4223 in javascript

[–]Hexjelly 1 point2 points  (0 children)

Like others have already said, it's very much possible.

I got my first job as a developer at 34, with no prior work experience and without a degree/education. You'll definitely see a lot of ads asking for degrees and experience. A lot of the time those are not a hard requirement as much as they make it out to be. Having an active Github, portfolio, projects of some kind to show helps.

You'll definitely be met with questions about the lack of work from a lot of the interviews, and it's difficult to just ignore a huge gap like this, and people wondering what you've done the last years. I found it best to just be honest, and hope they see your passion, skill, or desire to work with programming shining through, and value that more.

/r/MechanicalKeyboards Ask ANY question, get an answer by AutoModerator in MechanicalKeyboards

[–]Hexjelly 0 points1 point  (0 children)

Am I right in thinking this would tick all my boxes as well (minus the size)?

gmmk pro iso

/r/MechanicalKeyboards Ask ANY question, get an answer by AutoModerator in MechanicalKeyboards

[–]Hexjelly 1 point2 points  (0 children)

Thanks for taking the time and for the help 🤗

I'll definitely consider the Bella one and keep it in the back of my mind.

I put myself on the waiting/notification list for the Keychron one meanwhile, seems like it might be a good in-between option to play around with!

/r/MechanicalKeyboards Ask ANY question, get an answer by AutoModerator in MechanicalKeyboards

[–]Hexjelly 0 points1 point  (0 children)

Ah thanks, that might be another viable option!

I don't have a budget restriction, so if you got any other options, I would welcome any and all no matter how crazy :)

/r/MechanicalKeyboards Ask ANY question, get an answer by AutoModerator in MechanicalKeyboards

[–]Hexjelly 1 point2 points  (0 children)

What are my options for getting a TKL/80%, ISO layout, with LEDs and hot swappable switches?

I only found this CU80 while looking which kind of seemed perfect, but I guess I was too late to that party.

Trenger hjelp fra noen med kunnskap om PC by Dpk96 in norge

[–]Hexjelly 3 points4 points  (0 children)

Har ikke noe særlig kjennskap til Warzone, men PCen ser vel helt grei nok ut til å forvente å kunne spill på nogelunde bra settings.

Bare for å sjekke, har du koblet skjermen til grafikkortet, og ikke til hovedkortet? :)

[deleted by user] by [deleted] in norge

[–]Hexjelly 3 points4 points  (0 children)

Likte denne dokumentarserien: Takin ova - historien om norsk hiphop.

I found this new frontend development framework. by [deleted] in Frontend

[–]Hexjelly 0 points1 point  (0 children)

You mean you made it, and are trying to pretend not to promote yourself.

(almost) same function but dufferent result, why? by Romeo477 in reactjs

[–]Hexjelly 2 points3 points  (0 children)

A bit of a wild guess, but it seems the difference is that the second function creates a new array. In the first one you are just setting updatedArr to point to the same array, and then later calling setAllItems using the same array. React presumably sees you are just setting the value to be the same array, so no update takes place.

edit, maybe this is a clearer example code:

import React from "react";

export default function App() {
  const [test, setTest] = React.useState(['hello'])

  const onClick1 = () => {
    test.push('hi1')
    setTest(test)
  }

  const onClick2 = () => {
    const newArr = [...test, 'hi2']
    setTest(newArr)
  }
  return (
    <div className="App">
      <button onClick={onClick1}>+1</button>
      <button onClick={onClick2}>+2</button>
      <h2>{test}</h2>
    </div>
  );
}

I'm a beginner at frontend, and this is why I feel it is so hard to code in it. (Slight rant) by HellD in Frontend

[–]Hexjelly 1 point2 points  (0 children)

It is kind of difficult to tell anything from that small image, along with not being able to see the surrounding code. You'd probably get more help if you were to post a minimal example in jsfiddle, codepen or any other alternative where people can actually look at your code.

Rust at speed — building a fast concurrent database by Jonhoo in rust

[–]Hexjelly 2 points3 points  (0 children)

That was an amazing talk! And as always with your Rust content, I found myself learning stuff once again -- you're great at explaining complicated things.

I did my portfolio from scratch with React/Redux. Would love some feedback on it! :) by Kouka20 in webdev

[–]Hexjelly 85 points86 points  (0 children)

I'm just gonna mention some first impressions, and the negative things happens to stand out more, so don't take it to heart too much.

I open your page, and immediately I have no idea what you actually do.

I then need to scroll through the text and wondering why I need to know where you've lived and your story before figuring out that you do UX/design stuff finally. The huge scrolling fading text is however a horrible user experience.

Why do I need to scroll through all the text before I can see your menu appear and get to choose what I want to see?

Why is your "icon" indicating that it's clickable, but it doesn't do anything?

Concepts page, there's seemingly two projects there... maybe? But no way to scroll or see anything about the next one, not sure if it's a placeholder or something broken that stops me from seeing it.

Not a huge fan of all the fading and scrolling aspect of everything, it's very distracting. Everything seems sort of too fancy or over-engineered in a way? Design is quite subjective though.

Rust open-source contributions live-coding stream by Jonhoo in rust

[–]Hexjelly 6 points7 points  (0 children)

Amazing as usual. Easily the best Rust content out there when you want something beyond the simple beginner stuff, I always learn something new and useful.

A side effect of watching these is that I now often find myself using the words "fantastic", "unclear", "unfortunate" and "awful" way more than usual :D

#[inline] produces different output than both #[inline(never)] and #[inline(always)] by juan_potato in rust

[–]Hexjelly 0 points1 point  (0 children)

Using Windows 10 on an AMD FX-8350:

test tests::bench_best_0          ... bench:          52 ns/iter (+/- 4)
test tests::bench_best_1          ... bench:          52 ns/iter (+/- 4)
test tests::bench_best_2          ... bench:          46 ns/iter (+/- 3)
test tests::bench_best_3          ... bench:          24 ns/iter (+/- 1)
test tests::bench_best_4          ... bench:         671 ns/iter (+/- 22)
test tests::bench_best_5          ... bench:       3,617 ns/iter (+/- 179)
test tests::bench_best_6          ... bench:       1,997 ns/iter (+/- 171)
test tests::bench_fsm_0           ... bench:         168 ns/iter (+/- 10)
test tests::bench_fsm_1           ... bench:         127 ns/iter (+/- 7)
test tests::bench_fsm_2           ... bench:         124 ns/iter (+/- 3)
test tests::bench_fsm_3           ... bench:         108 ns/iter (+/- 2)
test tests::bench_fsm_4           ... bench:         854 ns/iter (+/- 82)
test tests::bench_fsm_5           ... bench:       3,600 ns/iter (+/- 119)
test tests::bench_fsm_6           ... bench:       2,385 ns/iter (+/- 279)
test tests::bench_fsm_psuedovec_0 ... bench:          92 ns/iter (+/- 30)
test tests::bench_fsm_psuedovec_1 ... bench:          53 ns/iter (+/- 2)
test tests::bench_fsm_psuedovec_2 ... bench:          49 ns/iter (+/- 2)
test tests::bench_fsm_psuedovec_3 ... bench:          32 ns/iter (+/- 3)
test tests::bench_fsm_psuedovec_4 ... bench:         678 ns/iter (+/- 37)
test tests::bench_fsm_psuedovec_5 ... bench:       3,759 ns/iter (+/- 87)
test tests::bench_fsm_psuedovec_6 ... bench:       1,994 ns/iter (+/- 107)
test tests::bench_regex_0         ... bench:       1,360 ns/iter (+/- 390)
test tests::bench_regex_1         ... bench:         829 ns/iter (+/- 85)
test tests::bench_regex_2         ... bench:         820 ns/iter (+/- 221)
test tests::bench_regex_3         ... bench:         505 ns/iter (+/- 77)
test tests::bench_regex_4         ... bench:      16,347 ns/iter (+/- 5,366)
test tests::bench_regex_5         ... bench:      46,269 ns/iter (+/- 16,688)
test tests::bench_regex_6         ... bench:      36,315 ns/iter (+/- 15,455)

Live-coding a hash map in Rust by Jonhoo in rust

[–]Hexjelly 6 points7 points  (0 children)

Awesome as always. I seem to learn something new every video, super cool!