python

joined 2 years ago
MODERATOR OF
[–] python@lemmy.world 2 points 1 day ago

I like your posts bc they're relatable

[–] python@lemmy.world 1 points 1 day ago

Ooh, there's a great Asimov short story about this! Victory Unintentional (1942)

[–] python@lemmy.world 2 points 2 days ago (1 children)

Rettungsgasse. It means that the cars on the leftmost lane pull over to the left and all other cars move over to the right. That always creates enough space for an emergency vehicle to pass through.

[–] python@lemmy.world 13 points 2 days ago

User was kicked from the polycule for this message

[–] python@lemmy.world 7 points 2 days ago (1 children)

Right, it oughta be at least 90°C to be nice and comfy

[–] python@lemmy.world 4 points 3 days ago

Well yeah, why would I learn html when I can learn React?!?

(/s but I actually did learn React before I had a grasp of semantic Html because my company needed React devs and only paid for React-specific education)

[–] python@lemmy.world 11 points 3 days ago

yeah, but only 50% of the time. The rest of the time I'm a Golden God who shall not be questioned by mere mortals

[–] python@lemmy.world 3 points 3 days ago (1 children)

Oooh, I interpreted the questions as fishing for their answers to common password security questions haha

[–] python@lemmy.world 5 points 3 days ago

I've been on it for a bit over a year now and honestly, it's just the new normal. Can't really say I miss anything, and things like the separate profiles are pretty neat.

Although, I have bricked myself once by enabling developer settings and accidentally changing my language to a dev-only language that made the os crash on boot. But the Graphene Devs fixed it and unbricked my phone within a week after I posted the problem to the forum.

[–] python@lemmy.world 5 points 3 days ago

Huh, I've always assumed that a bodega is a shop akin to those Japanese 7-11 stores. Like the kinda store that you see in those CCTV recordings of horses breaking through automatic store doors.

[–] python@lemmy.world 19 points 3 days ago (4 children)

For the opposite effect, walk into a room with other naked people and an air temperature above 70°C. Suddenly it'll be totally fine.

[–] python@lemmy.world 2 points 3 days ago (1 children)

there is another option

 

I mean, if I'm not gonna have a good match anyway might as well embrace the fact it doesn't match lol

 

As in, either at an early age or early in their career.
Because I'm 26 with about 3-4 years of experience (maybe 5 if I count my apprenticeship), and my company keeps reiterating how they promote based on skill and knowledge, and not based on age. I know that I fit the soft skill requirements for senior dev on the internal checklist. And I know that I could absolutely handle the 6-week project that potential Seniors are asked to do, because all of my experience is extremely specialized into the exact current field and position I work at.

So I'm playing with the idea of asking to become a senior next year, because I plan on leaving the company and the title would look good on my resume.

Does anyone around here have experience with doing something like that?

 

I installed Linux Mint for the first time on my personal Laptop just a few months ago, and it ran so well that I didn't want to mess with it to try out different distros.

But today, my company's IT department announced that they have some spare old Laptops to give away (technically because they didn't meet the specs for Windows 11, didn't stop the IT department from giving them out with Windows 11 pre installed though)

So now I got a few devices to play around with!! They're a Precision 7530 and a Latitude 7390 2-in-1!

I already got ZorinOS running on the little guy because apparently Zorin is nice for Touchscreen support. For the big guy I was initially thinking that I could try Bazzite, but the installer was like "Intel UHD Graphics aren't really recommended" so I might try something else first. Any recommendations? I mainly just want to try as many different flavors of Linux as I can haha

 

Not really a shower thought, but a "spraying my hair with dry shampoo before a Teams meeting" thought.

 

That is such a cursed combination of words. She climbed into my credit card holders metal loop while I was answering a Teams message and got stuck. Only started backing out voluntarily when I lubed her up. She's all right now, there was only a slight hint of a dent about 5 minutes later and it's all gone by now.

This is a shitpost because I realize that this situation is fertile grounds for puns and innuendos. Go ahead.

 

Okay so, context, I've come across this video last night. It's a short comparison between React and Svelte. Point 9 - Shared state (6:20) mentions that React doesn't really have a primitive way to share state between nested components and that you basically need to use something like Redux to get that working.

But... I've been sharing state between nested Components in just React for a while now and didn't know that I can't?? But I also don't remember where I learned to do it, so the chances are high that I just hallucinated up this method as a Junior.

Basically, when I want to share state I just make a new Context and ContextProvider, wrap it around the highest level Component I need it in, and use it lower down in the component tree.
If I need a state, I put the two outputs of the useState hook into the context (which feels nice because when I look through the code, I can see right away which children only read the value in the state and which children actually take the setter and have the capacity to change that state). Sometimes I don't even hand out the actual setter from the state, but a new function that also does some input validation before calling the setState itself. Doing it this way has always felt pretty clean to me.

From the React documentation, it seems to me like that's exactly how you're supposed to use Context. But I've also never seen anyone else do it like that. So is it incredibly ill advised and I've been shooting myself in the foot this whole time?

As a more specific example, my most common use case is that I need to render fetched data in a grid. This data can be filtered, but the component that sets the filter state is either on the same level as the grid (the grid's built in filter menu) or above it (a button that sets a predefined quick filter) or even further above that (a useEffect that looks for query parameters in the URL and sets those before the data is fetched for the first time).
So what I'd do is const [filterModel, setFilterModel] =useState() at the highest level and pass it to <FilterContext value={{filterModel, setFilterModel}}>. Then, I'd just use const {setFilterModel} = useContext(FilterContext) within all the components that write the filter and const {filterModel} = useContext(FilterContext) everywhere where I just need to read the filter, like in the hook that actually fetches my data. Does that make sense? Is there an easier/safer way to do it that doesn't involve adopting yet another external library?

 
 

I'd give laser pointers to Neanderthals. Even if they did figure out some useful application for them (maybe hunting?) they'd run out of batteries eventually.

 

On a touchscreen !!
Within a pan-pinch resizeable container !!
With a weirdly-shaped Grid !!

(Didn't know where else to post this, since it doesn't seem very relevant to !webdev@programming.dev, but I needed to exclaim this somewhere haha)

7
submitted 6 months ago* (last edited 6 months ago) by python@lemmy.world to c/webdev@programming.dev
 

Hello! I'm messing around with some PWA features and getting really stuck when it comes to display modes. Basically every browser and device I test on behaves wildly differently, and I'm having a hard time distinguishing which of those behaviors are errors on my part and which are just browser funkiness.

(Link to my PWA if you want to check the manifest or see how it displays for you)

In my manifest, I try to set the display mode to fullscreen. This setting seems to only be properly and consistently applied when I test on my Lenovo Tab 11 running Chrome. Firefox on the same tablet does not respect it and starts in standalone mode, unless I also have the Chrome Version of the PWA installed. Once that is the case, Firefox is beautiful and consistent. I have no idea why the different versions installed by the different browsers would interact with each other like this.

When I install the PWA on my phone (Pixel 9 Pro running GrapheneOS), via Chrome or Vanadium, the site thinks it's running in fullscreen, but I still have a black bar at the top (it doesn't apply the theme color set in the manifest!). This wouldn't be a problem per se, but the browser also sets a safe-area-inset parameter, which, when I respect it, leads to a very fat distance from the top (the safe inset is green):

spoiler

When I install it on my phone via Firefox, the app sometimes thinks it's display-mode:browser but displays perfectly fine as fullscreen, and sometimes it thinks it's fullscreen but displays more like a standalone. It seems completely random and can change any time I close the app or navigate away from it:
spoiler

When I install the PWA on my secondary phone (Moto G100) via Chrome, it has similar issues as on my main phone (it thinks it's fullscreen but is actually standalone) but it does not apply that ridiculous safe-area-inset. That backfires sometimes as navigating back via gesture will catapult the page to take up the full height, so the header shifts into the top bar. Would have been nice to have that safe-area here...
When I install it via Firefox on the Moto G100, it looks good about half of the time! Actual fullscreen with proper safe-area that doesn't break on navigation. Sometimes it randomly starts in standalone mode, but with the proper theme color applied to the top bar. Everything breaks if I have the Chrome version installed at the same time though. Then, the firefox version will never show up as proper fullscreen, but always have almost the same display issues as the Chrome version on that same phone.

I haven't even tested the PWA on iOS yet (I'll have access to an iPhone in about 2 weeks though so I'll test it then) but I'm guessing it will have its own display challenges as well. I'm also still battling the display issues from swapping my SVGs to generate with colors from the OKLCH system (it seems to really mess with any open source browser I've tried). So maybe, I should just ignore the browser display issues for now and focus on my color display issues instead?

Also, does anyone know if I can just let the user decide on their own preferred display mode? It would probably be the best solution to just let the user set the display mode that actually works in their specific browser. But as far as I understand how manifest files work, I can't really change much once the app is already installed, and I haven't found any online documentation that would suggest that I could programatically change the display property in the manifest based on user input :( But maybe there's some workaround you know about?

I would be very happy about some pointers and feedback on how I might get this display thing halfway consistent!

 

We might not live in the best timeline, but we sure live in the funniest one.

(no idea if it's satire, but I appreciate the dedication to the bit, especially when he started stealing merch right after)

Link to the videos Knowyourmeme page

 

Sorry, might be a stupid question, I have literally no idea about bikes!

What I'm looking to do is figure out whether there are any modern-ish ebike motors on the market that I could swap my current motor with (I'm assuming I'd be swapping all the other innards to fit that motor too, so dw about battery compatibility and the like). All I know about the current Motor is that it's a 250W Panasonic motor from around 2011. I asked the mechanic at my bike shop whether I could just toss one of those Bafang conversion kits on the bike but he said the way that my pedals sit within the motor would be incompatible with that and I'd need to get an actual ebike motor, not a conversion motor.

So now I'm trying to find information on current Panasonic motors and what sort of frames they need to fit, but I'm having a hard time because I have no idea how to even call this kind of spacing on the frame. Does anyone have an idea on what to call it/describe it as? Or is is a proprietary thing that I'd need a welder to rework? (Totally an option if push comes to shove, I know a guy)

Some more pictures from as many angles as I could get into (should I be getting measurements of any of these?):

spoiler

view more: next ›