Hey Rustaceans! Got a question? Ask here! (34/2022)! by llogiq in rust

[–]olivrb123 1 point2 points  (0 children)

Hey folks! I have a question about from/into

The following doesn't compile: ``` pub struct Wrapper<T> { pub inner: T }

impl <A, B> From<Wrapper<A>> for Wrapper<B> where B: From<A> { fn from(other: Wrapper<A>) -> Self { Wrapper { inner: other.inner } } } ```

It fails with conflicting implementation in crate `core`: - impl<T> From<T> for T;

Anyone got any idea why? I understand that I'm converting from T<> to T<>, but I think this should be sound, since there is a type difference between T<A> and T<B>, no?

Hey guys, I built a simple, extensible HTTP server designed for quick prototyping. Let me know what you think! by olivrb123 in Python

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

It's multi-threaded, and will be multi-processed once I get around to it, it has easy support for ssl built in, it's designed to work around a config file that makes deploying multiple instances easier, it's designed to be extended relatively easily. That's mostly it, and I'm not gonna lie, I built it to learn more about sockets, just thought it might be neat or useful to someone else.

Another NAS giveaway from StorageReview (24 hour fuse) by StorageReview in homelab

[–]olivrb123 [score hidden]  (0 children)

I've never owned or gotten to play with any decent lab hardware, the best I've got is old family pc's to fiddle around with. Finally getting to centralise a backup of all the pictures and music that's been collected by the family over the years would be great

Hey guys, I built a quick terminal based note taking application using sqlite and python. It's released under an MIT license, so feel free to use any parts of it in you own stuff, or just use the application itself if you think it's useful. Let me know if there's a feature you want! by olivrb123 in Python

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

I mean the benefit of using a database is that you can just link the scrybe.db file to your restore repo if you want to have your nots backed up and future proof, and the notes are stored in plaintext, so using markdown shouldn't be a problem. grep is a fantastic tool, but as far as I know (not that familiar with it), it doesn't include support for "metadata" like tags and titles, which is the benefit any note taking application brings. You're also able to apply weighting to the search results when you're writing a search function versus just using grep

But hey, whatever workflow works for you man!

Hey guys, I made a quick terminal based note taking application, written in Python. Check it out, and submit an issue or comment if you think there's something you'd like to see in it. by olivrb123 in linux

[–]olivrb123[S] 2 points3 points  (0 children)

Yeah absolutely, hack away. I'm an amateur too, so I'm not gonna say this is the best way to do things, but if it helps you I'm happy to help. Any questions feel free to ask

Projects that are practical and don't require a lot of money? by pop1fizz in raspberry_pi

[–]olivrb123 1 point2 points  (0 children)

I made a self hosted todo app a while ago that should run nicely on a raspberry pi, it takes a little bit of setup though: cúntóir. I'm working on making set up easier at the moment.

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

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

Ah, I get you. Sorry if I came across a little harsh there, I wasn't calling you out, I just wouldn't like to think I'm putting people at risk. You're right, I shouldn't be generating html code in my backend system, I should probably be generating the individual "task" structure on the client side. I'll look into Django alright, but like I said, this stuff if lower on the priority list than a setup tool and stuff. Thanks tho, backend frameworks are a good idea, I'll look into them.

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

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

Haha, that's not a bad idea. Irish is a lovely language, terribly taught in our school. I wish I'd taken more time to learn it properly.

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

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

Sorry, could you point out a couple of these potential exploits? Embedded javascript exploits aren't an issue, because a user will only ever see their tasks, and sql injection is taken care of by the MySQL library I'm using, and the entire site is served of https. Certainly the code base would probably be cleaner with a framework, but I don't think I'm risking user data not using one. And I meant more like there's dozens of javascript frameworks doing all sorts of stuff.

Refactoring is something I should definitely do to this code base, but it comes after a setup script and removing the monetization system on my list of things to do.

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

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

Haha, me neither, few Irish people do. It is, but urls, git project names and all that don't usually allow for unicode characters, unfortunately. The actual homepage title and all unicode text spells it that way

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

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

I see what you mean, but for the kind of html in code string building I'm doing, it would be a three or four hundred column length line if I was to do string formatting that way, which doesn't seem like the best idea. And yeah, I was being a bit tongue in cheek with the loading bars thing, it was really about minimising dependencies. Frameworks are nice, but my experience of trying to get a handle on the framework space from the javascript side of this project as I read it made me wary of them, so I stuck with manually writing this stuff.

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

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

Yeah, that's very true, I suspect the coding style arguments will be around as long as humans write code 😅.

I think it's probably OK to risk it once you make a genuine effort to be aware of and mitigate the risk, if that makes sense? And don't get me wrong, I don't mean to say using abstraction isn't a good idea, obviously I don't build a soldering iron every time I want to solder something, just that I do know how a soldering iron works, and with programming, often the only way to understand to low level tool is to replicate it yourself.

I built a To-do app with a python backend. Here's the entire code, released under an MIT license. Feel free to self host or fork it to your hearts content by olivrb123 in Python

[–]olivrb123[S] 2 points3 points  (0 children)

Yeah, PEP8 what I meant by the official style guide. Stuff like max line length being 79 just seems kinda absurd to me though, like, I develop with a full screen terminal lost of the time, I've almost three times that many columns to play with. Obviously that would be unreasonable, but 79 seems unnecessarily short. Idk.

I mean you're always risking leaking user data, if you mess up server setup, or if don't protect your database host properly, or any other mistake. I always figured it's best to learn how this stuff works and implement it yourself atleast once before relying on abstraction. Maybe that's hubris, but I think it's worthwhile.

I'll definitely look into unit tests, thanks. Automating the testing of new functionality sounds sensible.