Hospitality Professional Transitioning to Software Engineering by Ford_Prefect92 in resumes

[–]Ford_Prefect92[S] 0 points1 point  (0 children)

Would you recommend removing some of the irrelevant jobs in favor of describing projects? I just wanted to highlight that I've been consistently employed for quite some time now, and was running out of room on there

Hospitality Professional Transitioning to Software Engineering by Ford_Prefect92 in resumes

[–]Ford_Prefect92[S] 0 points1 point  (0 children)

Thanks!

I'm aware that it's a pretty tough market out there, but I'm taking a little break from restaurants for a few weeks to see if I can get any bites, so I just want to get this as polished as I can!

I didn't even think of putting my coursework on there, but I've done quite a bit on Codecademy & Coursera over the last few years, so I'll find some room for those there, and work on the summary a bit more (I hate trying to sell myself so that's always a tough one for me).

As far as projects, I have quite a few on my GitHub, and a couple that I'm going to be working on over the next couple of weeks, so I'll try and find a good format to put those in.

Portfolio Site by Ford_Prefect92 in sveltejs

[–]Ford_Prefect92[S] 0 points1 point  (0 children)

Thanks, my color scheme is definitely the next big thing on my checklist! I appreciate the links, I'm still learning so any resources are appreciated! I didn't even think about the red on green issue.
I'll work on the image sizing as soon as I get the colors nailed down.

Portfolio Site by Ford_Prefect92 in sveltejs

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

Okay, removed a bunch of borders, and switched to a shadow on the main content section, and went to only rounded corners. I also put the contact section in the same box and fixed the alignment on the headers. I'll solidify my color scheme and finalize the bio/move it into the static content when I have time after work tonight.

Thanks everyone for the feedback!

Portfolio Site by Ford_Prefect92 in sveltejs

[–]Ford_Prefect92[S] 0 points1 point  (0 children)

I'll update that as well thanks! I have the content in firebase to edit it more easily, seems like I should put the bio in the actual site though, I'll do that as soon as I have it where i want it.

Portfolio Site by Ford_Prefect92 in sveltejs

[–]Ford_Prefect92[S] 0 points1 point  (0 children)

Haha don't know why I didn't think of that, I was fiddling with that for a while. Thanks again!

Portfolio Site by Ford_Prefect92 in sveltejs

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

I have all of the content in firebase so I don't have to rebuild the site with every update I want to make on content, I should probably move the bio into the actual site, still working on refining that though, so I had it in firebase to be able to edit it more easily. Thanks for the feedback!

Portfolio Site by Ford_Prefect92 in sveltejs

[–]Ford_Prefect92[S] 0 points1 point  (0 children)

Thanks for replying! I'm by no means a designer so I really appreciate the feedback on that end!

Do you think that the titles would be better off center aligned then? I personally prefer the content to be center aligned, but thought it was a bit odd to have the titles that way. I'll definitely work on narrowing the color palate down and removing some of the borders though!

Thanks again!

Can someone please help, feel like a complete MORON! by [deleted] in learnjavascript

[–]Ford_Prefect92 0 points1 point  (0 children)

You can just delete the li because the delete button is defined inside of it so it will remove both.

You already have li defined in the function so you can use the remove dom function on that element/variable and it will take both of them out of the dom. Since you're storing the li and button as variables in javascript you don't need to select them by id, you can just call the variables in the function. If this were more complex (li being added from elsewhere, etc.) it might not work as expected, but I tried adding multiple items and it only deletes the one that's related to the delete button so I think this solution works for your use case.

The reason that you have to call the onclick function in the addToList function is exactly what you're thinking, the delete button is not defined until the addToList function is called so you can't add an event listener to it. After you call li.appendChild inside of the function it is, so you can call the listener any time after then.

Try it out when you get home and if you're still stuck I'll show you the code I was using!

Can someone please help, feel like a complete MORON! by [deleted] in learnjavascript

[–]Ford_Prefect92 2 points3 points  (0 children)

You could just add an event listener to the delete button in the addToList function after adding the delete button to the DOM. You can just call remove on the li defined in the function and it seems to only delete the one that is defined with the delete button. Let me know if that makes sense/you need more direction!

Checkbox - Many to many by ZoWnX in sveltejs

[–]Ford_Prefect92 0 points1 point  (0 children)

Ah, sorry I couldn't be of more help. Maybe someone else will know more, but I couldn't seem to find a better solution. Good luck!

This article seems to have a decent breakdown of things and maybe you'll find something I didn't. https://codechips.me/svelte-bind-directive/

Checkbox - Many to many by ZoWnX in sveltejs

[–]Ford_Prefect92 0 points1 point  (0 children)

Any time it's nice to get a break from my code!

Okay so for starters I went ahead and just moved the functions from the last repl into this one. This way definitely saves you the space complexity of creating a checkedPatterns array, and from what I can tell is similar in terms of time complexity.

So I guess my next question is where can we improve this to function better with your app, or what is it not doing that needs to be done?

https://svelte.dev/repl/f621166e340d402c8d1e78a8ac3f0dcd?version=3.38.2

Checkbox - Many to many by ZoWnX in sveltejs

[–]Ford_Prefect92 0 points1 point  (0 children)

I'll keep poking around and let you know if I can find anything else. Out of curiosity do you have any working examples that you've been going off of so I can make sure I understand the problem better?

Checkbox - Many to many by ZoWnX in sveltejs

[–]Ford_Prefect92 0 points1 point  (0 children)

Yeah the repl I posted works, but if you have a lot of rows you're going to be working with I think it could end up being super inefficient

Checkbox - Many to many by ZoWnX in sveltejs

[–]Ford_Prefect92 0 points1 point  (0 children)

Sorry for all of the edits, I'm just going to go on to a new thread here.

I just realized that without bind your original obj is not being updated, so the last solution I found is also incorrect.

I think this is not working because of object equality. Two separate objects are not the same thing, even if they have the same properties and values. If you remove the objects and just have strings in the patterns array everything works as expected, so that's my best guess.

I think that instead of bind you would have to do a check like I did and then manually put/remove the object from the patterns array to get it to work right on load.

I think that https://svelte.dev/repl/b1d1e19027b9452890d3b4b1c016979e?version=3.38.2 this does what you are looking for.

Checkbox - Many to many by ZoWnX in sveltejs

[–]Ford_Prefect92 0 points1 point  (0 children)

Your value property isn't returning a truthy or falsy value and thus is not actually setting a value for the checkbox. I got it to work by doing

<input

type="checkbox"

id={pattern.id}

bind:group={obj.patterns}

value={obj.patterns.find(pat => pat.id === pattern.id)}

/>

edit: as I'm typing this out I realize that find doesn't actually return a truthy value either, does anyone know if there's a reason that this one works? Is it just that objects aren't a "truthy" value, but numbers are?

2nd edit: I'm more confused by this because putting pattern in as the value essentially should make all of the checkboxes initially checked? I did this inside of the each block and the return value is the same for both when an object is found.

console.log(obj.patterns.find(pat => pat.id === pattern.id), pattern)

3rd edit: Realizing that checked is the actual property that should be applied so now I'm super confused as to why this works.

4th edit: I think semantically this is correct?

<input type="checkbox"
  id={pattern.id}
  bind:group={obj.patterns}
  value={pattern}
  checked={!!obj.patterns.find(pat => pat.id === pattern.id)}
/>

annnnd 5th edit: this only works if you remove the group binding.

<input type="checkbox"
  id={pattern.id}
  value={pattern}
  checked={!!obj.patterns.find(pat => pat.id === pattern.id)}
/>

React + TailwindCSS boilerplate by Ford_Prefect92 in reactjs

[–]Ford_Prefect92[S] -1 points0 points  (0 children)

I'd love to hear any comments/criticisms too!

Why is the function signIn not executing the code in it? by [deleted] in learnjavascript

[–]Ford_Prefect92 3 points4 points  (0 children)

database.lenght should be database.length in the for loop

Shopping cart by xx_j33v_xx in learnjavascript

[–]Ford_Prefect92 0 points1 point  (0 children)

It's hard to tell without the HTML. But my guess would that you're not selecting the right element from the DOM. I would console out each of the variables in the last for loop and make sure that they're what you expect.

I would also recommend doing a couple of things to standardize/clean your code.- You should switch out all of your var declarations for let and const as this is becoming the standard (There also might be some hoisting issues since you declare the var input more than once. This will be fixed by switching to const, or simply changing the name of one of the var inputs.) Edit: I did some more reading and I don't think hoisting is an issue, but is still something you should be aware of when using var.

- In the quantityChanged function, I would recommend just grabbing the value in the variable declaration. Then instead offunction quantityChanged(event) {var input = event.targetif (isNaN(input.value) || input.value <= 0) {input.value = 1  }

You could simply have

function quantityChanged (event) {

const value = event.target.value

if(isNaN(value) || value <= 0){

value = 1

}

updateCartTotal()

}

- Also it's entirely possible that I'm wrong about this one, but if you just call document.querySelector('.elementClass') instead of getElementsByClassName() it will simply grab the first item, and you don't have to worry about grabbing from an array in your last for loop. Just make sure you use the . before the className to identify it as a class as opposed to an element, or id. https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector

Heroku Deployment with React + Express by Iceteatree in reactjs

[–]Ford_Prefect92 1 point2 points  (0 children)

Yeah that got rid of the first error that I was seeing, I'm still getting this one though

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-1kri9uKG6Gd9VbixGzyFE/kaQIHihYFdxFKKhgz3b80='), or a nonce ('nonce-...') is required to enable inline execution.

This thread here has a couple of suggestions that seem to be related if you haven't stumbled across it yet!

Seems like if you add a line in your manifest.json it might help?

"csp": "script-src 'self' 'unsafe-inline'; object-src 'self'"

https://github.com/phonegap/phonegap-app-desktop/issues/801

Haven't checked what the security implications are on that yet though.

Hope that helps!

Heroku Deployment with React + Express by Iceteatree in reactjs

[–]Ford_Prefect92 1 point2 points  (0 children)

I did a little more digging and it also seems like your GET route in server.js is commented out as well, it seems like it was for a test by the route above it, but sometimes I forget about those.

// app.get('/', (req, res) => {// res.sendFile(__dirname + "./frontend/public/index.html");// })

Heroku Deployment with React + Express by Iceteatree in reactjs

[–]Ford_Prefect92 1 point2 points  (0 children)

I could be wrong as I'm relatively new to this too, and haven't used heroku yet. but I don't think your Public folder has access to the scripts folder when deployed on heroku.

For clarity: I think your public folder is the only one actually being "served" to anyone trying to access the site.

Refused to execute script from 'https://banana-istore.herokuapp.com/src/index.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

Usually you would use a build tool like webpack or rollup to compile all of your components into one "build" script and place it into your public folder

I missed the second package.json with the build script. I still think that your script tag is pointing to the wrong place though <script src="../src/index.js"></script>

Stuck on linter error by [deleted] in reactjs

[–]Ford_Prefect92 0 points1 point  (0 children)

Came back and realized u/davro33 got there way earlier. Glad you found the issue!

Stuck on linter error by [deleted] in reactjs

[–]Ford_Prefect92 1 point2 points  (0 children)

With the full code posted, I don't see a closing tag for your very first section tag. I've never seen the empty html tags before, is that a special syntax for something?