HNHacker News
TopNewBestAskShowJobs

mattkenefick

98 karma · joined March 21, 2015

submissionscomments
mattkenefick··on Ask HN: Where do I find good code to read?
Sounds like you've been surrounded with bad code all your life. This isn't true.
mattkenefick··on Things you forgot (or never knew) because of React
React might be the single worst thing to happen to the web. Not because of the library itself, but what it spawned.. the way people write it.. the style of coding that surrounds it. It was a sad time when it rose to popularity. :(
mattkenefick··on Things you forgot (or never knew) because of React
I think you're underestimating that.
mattkenefick··on NativePHP: A framework for building desktop apps using PHP
Shame that project went the way that it did. A bit ahead of its time if you ask me. There were a lot of controls that phones just didn't support well enough which complicated the project. It was more of a Cordova or Haxe than an Electron though.

Unbelievably, Haxe is still actively maintained. I keep saying I'll get into it, but I never do.

mattkenefick··on Imaginary problems are the root of bad software
Try to make it not about the job itself. Reward yourself with other things that are non-code related.

"If I get 5-10 of these done today, I'll reward myself with..."

Or use your imagination in someway like kids do with action figures. It can seem strange but there's ways it less mundane indirectly.

mattkenefick··on Fresh – Next-gen web framework
Taking it a little personal, eh?
mattkenefick··on Absolute truths I unlearned as junior developer (2019)
This is like.. a list of things to avoid doing.
mattkenefick··on Laravel/PHP: Swapping out the pagination class to your own
I had some trouble swapping out paginator classes in Laravel so I wrote an article about my experience in case it helps someone else in the future.
mattkenefick··on Show HN: Setup 'Hacker News.com' to redirect to this website
It's definitely personal choice / for-yourself thing.

For me, I think it's fine to change things that are specific / personal. I have plenty of modifications for dev work, staging, etc.. but also refer to things like Corp.com (https://krebsonsecurity.com/2020/04/microsoft-buys-corp-com-...)

Google.com to DuckDuckGo.com is an exaggeration. I don't think people should redirect MSN to CNN; that's just confusing.

I think it's fine to redirect amazon.co, amazo.com, amazn.com to amazon.com. Could a unique site named "amazn.com" exist? Yes, but I would prefer it to go where I expected. Similar/typo URLs are often related to malware (but not always).

I seem to remember localhost.com had a landing page telling users "You mean to go to localhost".

But yeah, don't use this if you're afraid to redirect your own hosts. If you're like me and want to type "HackerNews.com" because you prefer it landing here.. then use the script.

mattkenefick··on Show HN: Setup 'Hacker News.com' to redirect to this website
I've become fed up with typing "HackerNews.com" into the address bar and having it go to SpaceRogue.

This script should install this to your hosts file on unix/windows.

The change is: 209.216.230.240 hackernews.com www.hackernews.com

Feel free to check my work. I'm just sharing in case anyone else wants to give it a go.

mattkenefick··on Show HN: Top Comment – Guess which comment was most popular [alpha]
Created a quick game mvp during coronavirus quarantine. It's ~2 days work and there may be bugs, but it's a silly concept just for fun. If you see anything noticeably bad or have any suggestions, let me know and I might address them; but it's a silly concept so.. I might not.
mattkenefick··on Show HN: StreetEasy Plus – Chrome Plugin for Better Apartment Hunting in NYC
This is a plugin that extends the website StreetEasy.com which is used for apartment hunting in NYC / NJ area.

I was recently on the hunt for an apartment and thought of a bunch of features I wish the website had, so I wrote this plugin to add what I could.

Decided to share in case someone needs to use it, or it can inspire someone, or if anyone thinks of anything additional that would be helpful.

mattkenefick··on Pure CSS Linear Gradient Mask Animation on HTML Elements
I debated a bit on whether or not this even needed to be written up.

Anyway, gist is that I wanted to do a linear gradient reveal over a complex background without Javascript.. and I couldn't find any techniques that worked.

At first, I tried something that didn't work as expected, then found out through a bunch of S/O threads that it also failed for others. The threads I read didn't have solutions to the problem.

I ended up getting it to work this way (in the article), so I decided to write about it on the internet in case anyone else runs into the same problem.

Hopefully it helps people that are running into this issue; if not, carry on.

mattkenefick··on Merging two ini/env keyval files and remove duplicate keys using awk
specific overrides base. top down.

Could be whatever way you want it to be really, but that's the case here.

mattkenefick··on Merging two ini/env keyval files and remove duplicate keys using awk
I ran into this issue today and couldn't find a great solution online.

Needed to combine multiple key/value files, like .ini or .env, and have some values override others while removing duplicates.

This script + example demonstrates how to use awk to remove duplicate lines based on their key.

mattkenefick··on Ask HN: What's your favorite elegant/beautiful algorithm?
Weighted randomization.

Objective: You have a list of things with a popularity score and want to get a random item from the list, but you don't want just ANY random item. You want it to be a generally popular item.

How it works: You take a key for the weight, we'll say `popularity` (0-100). And you have maybe 1,000 rows of content, each with said weight.

You sum up all the popularities to variable X. You set a random number between 0 and X; call it R. You iterate through your 1,000 rows (Y), and each iteration you subtract Y's `popularity` from your random number, R, and when R <= 0... you use that row.

---

Quick Example: https://jsfiddle.net/rL6a01ku/

Press "RUN" over and over to see the numbers change, but basically still stay the same.

mattkenefick··on Ask HN: How many hours on the weekend do you actually perform on side projects?
I spend most of my hours during the week.

Depending on what I'm doing and how much I want to get done, I'll usually spend a few hours each day between 10pm - 4am.

If it's a new project or a big feature, I'll carve out a large chunk of the weekend to work on it. Maybe start around 10am, work until 5pm... go get food or go to the bar after that. Do it again on Sunday unless I make other plans.

mattkenefick··on Show HN: Trailer Nite – Find something to watch tonight
1.) We'll save your list to localStorage so that you can come back to it later on the same computer. The reason we have Facebook/Twitter sign-in is so you can sync the saved list across devices. We chose FB/Twitter for single sign-on so people wouldn't have to do email/password. We're considering adding Google to it as well.

So you don't have to use login to save items for later; just use the same computer next time and they should be there when you come back if that's what you prefer.

2.) "Available Now" represents content that has a release date of today or earlier. We do have some content on here that's unreleased, upcoming, or early release.

I understand that "upcoming content" may conflict with the "Find something to watch tonight," slogan, but considering that over 98% of our content is available to watch now... I think it still applies.

mattkenefick··on Show HN: Trailer Nite – Find something to watch tonight
The category you land in is "Hot" which represents items that are new and popular. They generally end up being movies/tv series that are soon to be released.

If watch enough or click "Browse", you can start watching things based on what VOD you have (Netflix, Hulu, etc), what genre you're interested in, general rating, and more.

We thought that new-comers to the site would be more interested in seeing a trailer for Venom, Avengers, or Deadpool than seeing a trailer for Jaws or Scarface.

You can definitely browse the VOD, newly added, genres, etc to find something for right now at home... but you can also learn what's coming out, what's out now, and what was recently released (soon to be on DVD).

mattkenefick··on Show HN: Trailer Nite – Find something to watch tonight
Good find. Saw the flags for that, it should be adjusted (depending on cache).
mattkenefick··on Show HN: Trailer Nite – Find something to watch tonight
The logic around that is:

If you're scrolling, it stays open. If you pause the video, it stays open.

If you stop moving your mouse, we wait a couple seconds then fade out. If you move your mouse, it resets the timeout.

Some people would scroll a little then stop moving the mouse to watch the current trailer and were expecting details to fade away since they were no longer interacting with it.

I think I understand your point, but it's tough when some people expect A and some people expect B.

mattkenefick··on Show HN: Trailer Nite – Find something to watch tonight
It can be tough for thrillers / suspense films where it's best when everything is a surprise, but I have no idea how you market something based on: "Trust us, it's really good but we can't tell you anything about it."

Infinity War did some interesting advertising where they changed scenes intentionally so you couldn't follow the timeline in the actual film. They "lied" in the trailers, but I think it worked out for the best.

mattkenefick··on Show HN: Trailer Nite – Find something to watch tonight
Author here: The point of this project is to discover movies and TV shows that you ordinarily wouldn't find because the studios put their advertising money into something else.

Now that we have so many ways to watch content: Netflix, Hulu, Amazon, HBO, theaters, cable/dish, etc... there are so many options, so many new original series, and it's nearly impossible to follow along with new releases. It's great to have all this new content, but not if you can't find it.

Trailer Nite is a fun way of discovering new content on platforms that you use. Every trailer is like a short film. It's about 2 minutes long with its own tone, with its own entertainment value, and if you like it... you can watch the real thing.

Anyway, this came out of a utilitarian need for me and then grew to be more. Hopefully it helps some other people out there that enjoy movies/tv like I do.

-------

Backstory:

A few years ago, I got into a show recommended by Hulu. After the second season ended, I was like "Hmm, I wonder when the next one is coming out?" Turns out, the show had already been canceled for a year. I had never even heard of it. I probably would've watched it if I knew about it. That would've increased their ratings (if enough people watched) and it could still be on today; but it's not.

I've found several movies using Trailer Nite that I never heard about. Some were recently released with several famous people starring in it, but it didn't matter. I watch plenty of TV and I see plenty of commercials so it's really surprising to me that this many movies and shows are released with little to no advertising.

Edited for grammar / wording.

mattkenefick··on Ask HN: Creating a Mastodon Instance for My University Society
Do you have any programming experience at all?

"Learning Vue" won't cut it. Do you have any backend, database, frontend, etc... any experience?

mattkenefick··on Ask HN: Which browser for web development and why?
Very glad I didn't see any "Safari" in here.
mattkenefick··on Ask HN: One thing you wish would happen in the next 10 years?
What do we do about population control when we have cures for diseases and better health care that extends the life of everyone?

We're already having a hard enough time with crops for coffee, avocados, and more due to high demand and climate change.

mattkenefick··on What I've Learned So Far as a Programmer
This is one of the funniest headlines I've read considering the site seemingly crashed. I'm hoping the punchline was actually "Error establishing a database connection" but I doubt it.
mattkenefick··on A set of best practices for JavaScript projects
These practices aren't even good.
mattkenefick··on Chess.com stopped working on 32bit iPads because 2^31 games have been played
"Obviously unforeseen.. impossible to predict." Really? You don't know how to properly store ID numbers?

IMPOSSIBLE to predict.

mattkenefick··on Ask HN: For those programming 10+ years, what do you wish you knew 4 years in?
If the timeline is so tight that there's no buffer zone for QA, exploration, etc then someone isn't doing their job properly.

Either expectations set by the developer, improper buffer added by the project manager, or lack of push back against the client.

← PreviousPage 2 of 3Next →