1. 6

    Over the weekend i finished integrating CoreData with a reminder/todo app I am writing for myself.

    This week I’ll try to add reminders support to the app.

    side note: learning iOS development with Swift UI is pretty painful, the docs are incomplete, all the posts are from different versions of the API and i don’t have the patience sit and read all docs to find what I need.

    1. 2

      CoreData, although very versatile and powerful, seems overly complex for simple apps that just need a basic, secure data store. Especially if you’re building an Apple Watch app. Actually was very discouraging when I was trying to whip up a quick PoC of an idea a few weeks ago. What’s your take?

      Also, I loved Swift when it first came out. But after revisiting it years later…has it become a bloated language or what. So many decorations and ways to do the same thing…I feel like I’m in a Party City (I don’t like shopping for party stuff).

      1. 2

        I agree with both of your points, CoreData is complicated but the value it provided me is high. I think once i had the Objective-C style delegate listening for updates, then i didn’t have to touch it again.

        Swift is too bloated or Swift UI uses too much, i was confused with @State, @StateObject and the million combine annotations.

        I am more of a Go style engineer, i like thing simple and my brain can’t handle too much bloat. Minor things like trying to discover which package provides which struct is a PITA. (is @Published from SwiftUI import or Combine…)

        But after a day and a half of struggling, looking for examples, i think i finally get it enough to not want to rm -rf the project and move on. I might spend a few days lightly reading the docs for both swift ui & combine after finishing the project if they are not deprecated by then….. feels like i am in js land all over again.

        1. 3

          As a go engineer who has tried a few weekends of swift, my experience was very similar. Especially about incomplete docs and outdated examples. I really feel like the barrier to becoming fluent & productive is unnecessarily high, perhaps if i could dedicate a few weeks to nothing but iOS dev i could get somewhere.

    1. 6

      Hi, i’m the author of The Webpage, which is now open source! https://github.com/arussellsaw/news

      I had a lot of really good feedback about the layout the last time i posted this, now i’ve switched to truncating the articles client side based on the calculated height of the slot they’re in, which has led to a much more even page overall, and far fewer blank spaces.

      Please let me know of any feedback you have, i’d love to hear it. I’m working on getting the layout engine and ui working right, and making the backend more scaleable at the moment, i’m looking to add user accounts with custom RSS feeds sometime soon.

      1. 5

        Thank you for the cool RSS reader!

        Could you add a license for your code to your repo, to make it clear that people are welcome to contribute?

        I personally prefer the AGPL. I agree with Bruce Perens saying there are too many licenses creating license compatibility problems. That said, I’m ok with any license approved by the FSF + OSI. (Not that my opinion matters, since I’m just a random dude on the internet.)

        1. 3

          ah good catch, thanks! i’d been working privately on this so it hadn’t crossed my mind, i’ve added GPL as the license

          1. 6

            just saw your edit and did some reading about AGPL, that’s much closer to what i need, thank you! i’ll update the license now

            1. 4

              No problem, I’m very glad to hear that!

              Personally I believe it’s best to use AGPL for everything, even programs that you don’t currently expect to appear on web pages, because you never know what the future might bring. Maybe thin clients will come back, like Google Stadia, and everyone will be running your software from the cloud, and without the AGPL they won’t have access to the source code.

              1. 1

                You may want to rewrite git history, because now someone could fork bca3ea68e under the GPL.

                (Unless you don’t mind of course.)

        1. 6

          Hey, this is a really interesting problem that i think lots of companies hit without noticing, however i think there are simpler ways of tackling it, i figured i could give a few pointers on how your code might be simpler and smaller.

          Firstly with your DisconnectContext you can eliminate stubbing a lot of your fields by embedding the parent context rather than stubbing them eg:

          type DisconnectContext struct {
              context.Context
          }
          

          then only overriding methods you need to change the behaviour of (https://golangbyexample.com/embedding-interfaces-go/).

          edit: i just deleted some stuff about wrapping in another WithCancel to avoid the DisconnectContext from this comment because i was wrong!

          here’s the example i used to prove myself wrong : https://play.golang.org/p/ynNwc-otFGO

          1. 5

            Thanks! I intentionally didn’t use embedding so that I could explicitly show the delegation of Value to the parent. Otherwise, that would be the only method missing from the impl and might be lost to the reader.

            1. 2

              This is roughly what we do at DO. The main thing is that your DisconnectContext wraps its parent but noops on Done()

            1. 23

              You download a single binary executable. You run it. There’s no step three.

              Step three is pairing your devices. Step four is to setup autostart.

              SyncThing is great. No need to oversell it.

              1. 13

                Step 5: build and maintain a server for syncthing so that the risk of offline devices not catching all the changes is lowered. (Optional I guess).

                1. 3

                  And then there’s punching holes through networks where you don’t have a peer but want to sync from an Internet server

                  1. 5

                    It’s not a problem in Syncthing, there’s always a pool of public relays

                    1. 2

                      A-ha.

                      So, how does that effect possible unintended 3rd party storage of your backups?

                      1. 3

                        It should still be impossible, the relays don’t actually store any data, just act as introducers for your data nodes

                        1. 2

                          I may be misunderstanding, but don’t they still need to be active to relay the actual information?

                          1. 2

                            the information they relay is a TLS ciphertext stream, authenticated by the device IDs which are actually sha-256 fingerprints of the TLS certificates

                            1. 2

                              Ah, that’s much more reassuring. Thank you! :)

                      2. 1

                        That must have changed since I last used it. Thanks!

                    2. 2

                      which is only two commands away if you have Arch lying around:

                      pacman -S syncthing-relaysrv
                      systemctl enable --now syncthing-relaysrv
                      
                  1. 2

                    i fixed the janky scrolling! you can now hit (read more) and be taken to a whole article page https://news.russellsaw.io/

                    1. 1

                      Right now it seems that the newspaper is updated and articles moved around every time the page is reloaded. I’d perhaps suggest to make the contents static and update it once every 24 hours or so? And perhaps provide an archive of permalinks to each day’s newspaper? That would make it even more like a newspaper.

                      1. 1

                        Yeah that’s something i definitely want to do, right now it’s all stateless though, so once i hook it up to a database I’ll start storing probably two editions per day, morning and evening

                        1. 1

                          Cool!

                      1. 5

                        I’ve had that bug too a couple times, not sure why. I’m hoping that this fixes itself when i get rid of the scrolling this evening 🤞

                      1. 2

                        I would think it could be an especially good fit for e-ink readers with a working web browser (does the reMarkable e-ink tablet[1] that seems to have become relatively popular recently on the interwebs have one?) — though given the poor refresh rate of current e-ink screens, it too would probably depend on inventing some alternative to the scroll & zoom workflow. If you find a way, you may like to let e-reader and reMarkable users know via reddit and/or some other kinds of forums; they might love it! :)

                        1. 2

                          I’m going to replace scrolling with truncating the text, and having links to a single article page view. Hopefully i’ll get that done this evening

                          1. 2

                            It would be nice to set the text of the link to “Continues on page 42”. xD

                            1. 1

                              That was my plan!

                        1. 12

                          great idea and execution! especially for the mono toned images! I love it.

                          however, maybe you should disable the scroll effect on article content and make the page background more paper-like :D

                          Do you plan to open source it?

                          1. 6

                            thanks! the scroll effect is one of the tools i use to hide a lot of the sins of not being very good at laying out the articles. I’d like to disable it if i can but i think first i need to solve the problems mentioned here https://lobste.rs/s/ureotv/webpage_serverside_rendered_lo_fi_rss#c_3topbx, or truncate the articles to their box size in javascript, not sure which yet. If i truncate i’ll either have a modal view to the whole article, or just link directly to the source.

                            as far as open sourcing it, yeah i think i will. depending on how much people like this i’ll probably add in the ability to choose your own feeds, categories, and layouts and might have a hosted version people could pay for, or an open source one you can host yourself.

                            1. 4

                              That’s great to hear, would love to see the source, set something like this up for myself. It looks great!

                              1. 1

                                Maybe use the column layout like iht.com used years ago.

                                http://www.smokinggun.com/code/sg_layout.php

                                1. 1

                                  great! keep up the good work. i’m looking forward for a hosted version, i’ll definitely pay for it!

                                  1. 1

                                    Very cool!

                                    I wonder if CSS grid can help with the layout. It seems like you would want to place articles into columns left-to-right like this: https://jsfiddle.net/4w8ysrqo/1/

                                    The part I can’t figure out is how to automatically set the height in grid cells based on the height in pixels.

                                1. 7

                                  Unless it’s intentional, you might want to make it so that text it correctly justified and hyphenated instead of splitting lines in the middle of words. It would also be great if the body text were at a more readable size.

                                  Either way, it looks and feels really cool! I like the lo-fi graphics.

                                  1. 1

                                    I tried using word-break: break-word and text-align: justify on my browser and it’s slightly (?) better. But there are still massive rivers in the text :/

                                    1. 1

                                      hyphens: auto, maybe?

                                      1. 3

                                        I have the following in my CSS that seems to work fine. I’ve forgotten what each one does though.

                                        hyphens:               auto;
                                        hyphenate-limit-chars: 6 3 3;
                                        hyphenate-limit-lines: 2;
                                        hyphenate-limit-last:  always;
                                        hyphenate-limit-zone:  8%
                                        
                                    2. 1

                                      yeah you’re right, i’ve been playing around with different methods of line breaking, and will probably continue to do so. The biggest challenge with this has been getting articles of arbitrary size to fit within a given layout. I might move the backend to work out the best layout dynamically based on the articles, rather than finding the best articles for a given layout.

                                      I’m torn on text size, to me this is one of the things that most authentically make it feel like a newspaper, and the application i’m interested in is reading on my ipad, where i can zoom in on any particular article, but i really value accessibility, so i’ll have a think about what i can do.

                                      1. 2

                                        About the font size: I just installed all of the proprietary Microsoft fonts on my Linux system (for a different reason) and now it reads much more easily. Going from Liberation Serif to actual Georgia makes the text appear to be a lot larger as well. I think this is an issue just because Georgia looks really big and most other fonts are much smaller in comparison. Maybe you could specify Merriweather as a fallback since it also is pretty large. That said, maybe you don’t want to introduce a web font dependency.

                                        Edit: you already have another .woff, so maybe you could add one for the body font.

                                        1. 1

                                          I’m torn on text size, to me this is one of the things that most authentically make it feel like a newspaper,

                                          The only thing which makes newspaper column width legible is the justification of the text. You also need larger spaces between columns.

                                      1. 8

                                        Working out whether or not to quit my job and start hacking on small software businesses.

                                        pros:

                                        • i have enough savings to not have any income for at least six months
                                        • i can fall back to part time remote contracting
                                        • i can finally spend time with my partner who works nights
                                        • constantly stressed and anxious in my current job

                                        cons:

                                        • leaving behind 3/4ths of a potentially very lucrative options package
                                        • it might take me a very long time before i equalise income with where i am now
                                        • there is a lot of opportunity for growth where i am now
                                        • it’s objectively the best job i’ve had
                                        • i’m wondering whether this is just due to SAD and i might regret this in a few months when i’m feeling better

                                        I’ve been wanting to do this for so long, but it’s a big leap to make, especially without having established a viable business on the side before making the leap. I’m also seriously concerned about regretting this and being bitter down the line.

                                        1. 8

                                          Maybe ask if working part-time in current job is an option, and try to hack something without quitting.

                                          1. 5

                                            Before you quit your job, I recommend checking out Growing Gills, by Jessica Abel. It might give you a tool set to start the side business before you quit your day job.

                                            Also, is the anxiety internal or external? Is it related to deadlines/your boss etc? Or is it hard to pin down, or internal? If it’s internal, it might be worth looking into counseling, since going solo won’t fix that.

                                            1. 2

                                              Can I have your old job? Sounds great :) I really think you should stay, for what it’s worth.

                                              1. 2

                                                I suggest don’t quit. Work on modifying the current work conditions.

                                                1. 2

                                                  Ouch. FWIW I’ve told my boss at the company that there’s a good chance of mms leaving (back to freelancing) due to some potential family developments. And a day doesn’t go by without questioning of I should do it or not.

                                                  But I’ve been here before: did I leave a really great job to something I’m not certain is good for me. And i know it’ll end up well no matter what. We’re lucky to be in well paid line of work and can risk things - even with less then 6 months worth of stash and with kids.

                                                  What I’m trying to say is that you shouldn’t worry, whichever you choose it’ll most likely turn out just fine.

                                                  1. 2

                                                    6 months seems like a very short runway, I’ll have to make the go/no go decision for putting your project aside with enough time to find and start a job, then make it to the first payday. If you plan on at least 2 months for that process, and another 2 months buffer in case something goes wrong and you have to start over, then you have two months to make that business bring in enough income to sustain yourself.

                                                    I’d recommend a) reading around the FIRE community for a little while to get a sense for sustaining yourself on investments and safe withdraw rates. Then b) reading about how long it usually takes for a small software business to start generating enough income to cover your expenses. From there you need to get a larger than b with enough of a buffer in case something goes wrong, say like the stock markets dropping 5% in two days.

                                                    edit: also really dig into what’s wrong with your current job, and talk to your boss about fixing it. They’d probably rather smooth things out than have to replace you.

                                                  1. 7

                                                    I’ve been using this for a few months now and the performance between this and 9k is like night and day, I work in huge git monorepos, this was a drop in replacement and makes my promos so much more responsive

                                                    1. 5

                                                      Thanks :-)

                                                      Make sure to update powerlevel10k if you haven’t for some time. Powerlevel10k guarantees backward compatibility with all configs, so your prompt will keep looking just like before. It will get faster over time though as I’m constantly optimizing code.

                                                      1. 1

                                                        The performance difference is especially pronounced if you use instant-prompt mode.