Threads for weaksauce

  1. 2

    Can anyone who’s tried sorbet comment on why you’d want to use this instead of crystal?

    1. 10

      your question is ‘why x instead of y’, but these two are not direct competitors/alternatives, though both are related to ‘type checking ruby(-esque) code’.

      sorbet is a ‘checker’ that can be used on top of an existing ruby codebase, which also means it can be gradually adopted. this is similar to mypy in the python world.

      crystal, on the other hand, is a separate (though similar looking) programming language with no direct interop with the ruby ecosystem. instead, it compiles to machine code, as opposed to running inside a ruby interpreter/vm.

      1. 1

        yeah crystal is like elixer… similar syntax but distinctly different and incompatible.

        1. 1

          Thanks. “Ability to gradually migrate” does answer the question

        2. 4

          completely different languages and runtimes?

          it’s my understanding that sorbet, and the new type checking functionality built in to ruby 3 using RBS can be implemented gradually in existing ruby projects

          crystal would require a rewrite

          1. 1

            I am more interested in that exactly: What have people’s experiences been between RBS and Sorbet? They seem to approach the same problem, but I suspect they’re not entirely overlapping. As such, I find myself wanting to gather the experiences of someone who has tried both before deciding which I might gradually introduce into a project.

            1. 6

              I wrote an online poker virtual table in ruby without any typechecking at the start of the pandemic. It went swimmingly.

              After playing for a few weeks I realized about a dozen tweaks I wanted to make. Diving back into the code was a little difficult and I grabbed Sorbet (my first go at it) and I found it really helped me keep things straight. I used the types sparingly at first, mainly to document my assumptions about parameters for certain functions. In some places the type signatures got complicated and I took that as a hint to refactor. Decent experience all around. The worst part was the way it loaded gems when probing for type signatures in my dependencies. Thankfully that was a smaller project, probably 2k LoC with a half dozen dependencies. I can’t imagine how a large rails application would fare in that process.

              Later RBS was released and I figured I’d port my game over to it since the official nature of RBS seemed to challenge Sorbet and the future might demand I make the change. I didn’t like any part of it. The definitions being in a separate file was probably the worst. It meant that those useful notes about my assumptions (in the form of type signatures) were an extra step away. The error messages coming from the Steep tool were significantly less understandable than the Sorbet messages. It ran slower in most cases too.

              My current day job doesn’t use ruby but if it did I wouldn’t necessarily advocate for my team to adopt either tool. If someone else did, I’d be happy to help bring in Sorbet and I would argue strongly against RBS. The experience of no type checking was better than RBS.

              1. 1

                Thanks for sharing your experiences! I’ll probably try out Sorbet first on a smaller project, and get a feel for it.

        1. 34

          I particularly enjoy the Change In/Around commands: ci" replaces the inside of whatever double-quoted text block you are in, ca' replaces the single-quoted text block including the quote characters, and there are variants for various brackets, braces, parens, and paragraphs!

          1. 14

            another fun fact about ci” is that you don’t even need to be inside a double quoted string or whatever… it will go from where you are on the line to the next double quoted string and let you change that.

            so ci” on this at the | :

            lor|em “ipsum” foo bar

            would change it to this with you being in insert mode

            lorem “|” foo bar

            1. 12

              Best paired (…) with https://github.com/tpope/vim-surround which is the first plugin I miss on a fresh installation of vim.

              1. 8

                See :h text-objects for more details. You can also create your own using omap.

                1. 3

                  I think this is a great introduction to writing your own text objects:

                  https://web.archive.org/web/20201108142554/https://vimways.org/2018/transactions-pending (web archive link because the site currently has an out-of-date certificate)

                  I mention is below, but kana’s vim-textobj-user is also very helpful.

                2. 2

                  If you like text objects, I definitely recommend checking out these. (People may already know about them, but just in case…)

                  1. 2

                    Oh wow, I always used ct" or xcf", but those obviously only work from the beginning of the block. These are great!

                    1. 1

                      Yup, we should learn about text objects sooner rather than later and hen get the kana/textobj-user plugin which will also give you a whole set of new text objects to play with. There are also alternate approaches like targets.vim.

                    1. 2

                      g commands when using it from the colon mode (command mode? i’m not sure what that’s called) same way as you’d do a find and replace in a file

                      something like %g/^ *$/d will delete the empty lines in a file or %g/WARN/d would delete warning lines in a log

                      useful for deleting all the lines that you don’t want to deal with in a log file or you can also perform other operations with it by replacing d.

                      1. 4

                        Mine is moving ctrl to my capslock key, and then becoming proficient with the various c- prefixed keys like <c-w> for window navigation and <c-p> or <c-x><c-f> and others for completion.

                        1. 2

                          It is even better if you move escape to capslock; For vim, escape is the main meta key.

                          1. 2

                            I agree! I have my caps key mapped to esc on tap, and ctrl on hold.

                            If I had to only pick one between ctrl and escape I would pick ctrl for remapping caps lock. The more I use my mappings that begin with ctrl, the more I appreciate having a ctrl key within easy reach. Also useful for other programs. And <c-[> sends the escape key, so it’s not too hard to press escape when needed.

                            1. 2

                              I don’t think there are many situations where ctrl-c doesn’t do the same thing as escape. It’s not a bad muscle memory anyhow for a similar concept everywhere else. I don’t remember the last time I’ve reached for escape in vim…

                              1. 1

                                imap kj <esc> is my favorite. Your fingers never need to leave the home row. Add this to your .inputrc to get the same effect in bash:

                                $if mode=vi
                                    set keymap vi-insert
                                    "kj": vi-movement-mode
                                $endif
                                
                                1. 3

                                  mapping kj and jk to esc is great because you just have to mash both them without worrying about the order… it’s liberating.

                            1. 28

                              g+, g- (mic drop)

                              No, in all seriousness, the documentation sucks on this… So I’ll explain it how it was explained to me by a colleague:

                              Vim stores edit history and undo as a tree. For example, if you do A, B, C, D, undo, undo, E, F, undo, undo, undo, G, vim will store this history:

                                               D        F
                                               |        |      G
                                               C        E      |
                                               |        |      |
                                               +----+---+      |
                                                    |          |
                                                    B          |
                                                    |          |
                                                    +----+-----+
                                                         |
                                                         A
                              

                              g+ and g- will navigate between the “tips” of this tree, so between D, F and G. One goes back, the other forward. I never know which one is which between g+ and g- to go the way I want, so I always try both until I realize it’s going the right way :) .

                              1. 6

                                The undo tree is one of the most import features that is missing from all „vim emulations“ in other editors like vscode, pycharm/goland, younameit.

                                1. 8

                                  Especially when you throw in a visualizer for it like mundo. Emacs has it as well.

                                  1. 6

                                    It should be noted that you can use proper vim inside of vscode if you use the neovim plugin. Basically all of nvim in normal/visual mode is available without much compromise. you can even call visual studio apis in normal mode if you map it in a vimrc.

                                  2. 3

                                    This is incredible. I’ve been frustrated when I’m at “G” realizing that no, I was right when I was at “D” and can’t go back.

                                    It’s too bad that the emulator in VS Code can’t do this

                                    1. 8

                                      if you use the neovim backend you can have the (almost) full power of neovim inside of vscode…

                                    2. 3

                                      JetBrains IDEs have a local history feature for this. It’s fantastic, as it shows you a merge view between your current state and the selected history state. So you can still edit the current state and cherry-pick bits from the diff trivially.

                                      1. 3

                                        This is a great tip. I also cannot recommend the plugin vim-mundo enough which builds on the builtin undo-tree to provide a panel that let’s one jump through undo histories, search within them and my favorite, diff them as well. Like a very convenient zero-cost mini git.

                                      1. 2

                                        Trying to make an Emacs-package + firefox extension which will allow me to “archive” my firefox tabs in an org-mode subtree. I am sick of having 30 tabs open out of which I only interact with 5 in a day, but am too paranoid to delete them. I am aiming for a consult/avy-buffer like UI for my tabs; so I can just archive a tab into a plain text file, and then go through my list of archived tabs. Maybe tag tabs as well, like Chrome’s tab groups. I’ve tried a lot of FF addons which provide a tree/groups for tabs, but I’ve found them to be too buggy and have often lost huge lists of tabs. I want my tabs in a plain-text file which is under VC so I can procrastinate them in peace.

                                        PS I use EXWM, so when I talk about consult-buffer like UI, I mean actual Emacs completion UI, not somethign in Firefox like Tridactyl.

                                        1. 3

                                          Make sure to check the native messaging part of the WebExtension. It worked for my “what was that github repo from X days ago” use case.

                                          1. 1

                                            I’ve been looking into that. I was unable to figure out how to get Firefox addon talk to Emacs. Because native messaging needs an app which accepts input from stdin and outputs to stdout, and this “native app” is started from browser’s side. But I couldn’t find a way to launch an emacsclient which can behave like this. So I’ve decided to write a small script (“native app”) which:

                                            • Starts on browser’s request
                                            • Along with stdin, watches a file for input
                                            • Browser sends its messages via stdin. Emacs sends its messages by writing to the file.
                                            • Browser gets its messages via stdout. “native app” will directly call emacsclient --eval '(some-elisp message)' to send messages to Emacs

                                            I couldn’t write any code to verify this though; I hope it’ll work.

                                          2. 2

                                            FWIW I recently found TabStash and it’s working quite great for me as of now, interface-wise. It let’s you easily archive tabs into bookmarks - so not into org-mode, but maybe it could help you solve part of your plan, e.g. you could sync just the bookmarks it created to org-mode, or fork the plugin and tweak its source to your liking.

                                            1. 1

                                              Why not just have a native messaging webextension that calls a small script that appends to a text file? if you want to have it in some special thing that needs to be processed by emacs for whatever reason you could have a minor mode or just a command that any time you switch to a particular buffer or run that command it takes from that file and merges it into the “master” file and then truncates the file or delineates the file in some fashion to indicate where to start for the next import.

                                            1. 1

                                              Understanding this code is over my head right now.

                                              Can someone recomend me what is the standard method to write a simple media player?

                                              Is it genrally like this:

                                              1. Read the frame, display on a canvas. Basically pixel by pixel
                                              2. Sleep a very small amount of time.
                                              3. Read next frame, display

                                              Of course, a lot of thing can be optimize, but is that a simplify version of how a media player work?

                                              1. 4

                                                https://github.com/leandromoreira/ffmpeg-libav-tutorial seems to be a useful tutorial about this. Though, have to admit, it’s been more than 10 years that I touched libav*.

                                                1. 3

                                                  Caveat my knowledge is all but theoretical. But here’s my first reaction:

                                                  1. Due to the encoding, you won’t ever read frames but instructions, e.g., about differences from the previous frame
                                                  2. There might not be enough time to sleep :-)
                                                  1. 3

                                                    basically yeah. though the way codecs work is that they don’t store all the data for every frame. they take a difference of frames and then calculate that. there will be different types of frames stored for different purposes and every so often you have a “check” frame that is kindof a reset frame that stores the full picture instead of a differential picture and that frame is used for the intermediary frames between those check frames (I frames vs B frames vs P frames) https://ottverse.com/i-p-b-frames-idr-keyframes-differences-usecases/

                                                    and typically you would not draw the frame directly but use some kind of buffering mechanism so that the frame can be shown on the screen instantaneously.

                                                  1. 10

                                                    I think the docker desktop license thing is grossly overstated. if you are rocking in a year a 5,000 dollar a month license for all of the max hypothetical 249 employees at the max business rate of 21 dollars each is not all that compelling considering it’s “business-critical software” per them. the real scenario is one of the lower tier licenses probably work and it’s more than likely way lower than 250 employees that use it. if you have 250 employees it’s more than likely you are pulling in a lot too.

                                                    1. 5

                                                      Kitten-proofing the apartment. We got two kittens this week, and every day they discover something new to get into.

                                                      Also, completely taking apart my NAS box and trying to figure out if it has a short, and where it is. I tried moving it (kitten-proofing), and, when I laid it on its side, its PSU died. It smelled like it completely burned out. So I bought a new PSU, and it worked briefly… until I flipped the tower on its side again, and now it won’t start anymore, again. Hopefully this one’s not dead.

                                                      1. 6

                                                        You can’t just mention kittens and not post a picture!

                                                        1. 1

                                                          ^ this.

                                                          cough up them pix, ar-nelson 😊

                                                      1. 15

                                                        The choice is between an Electron app or no macOS app.

                                                        Really? Were there no other cross-platform GUI toolkits you could have used?

                                                        1. 16

                                                          I wrote and maintain an Electron application. If I weren’t using Electron, if the application would exist at all, it would be Linux-only. There’s a very simple reason why: we use interactive SVGs a lot throughout the application, because we need an image that resembles a keyboard, and SVGs make that easy. GTK can’t do that, QT can’t do that. They can display SVGs, sure, but they don’t support interactive SVGs, only via a webview. Since about 90% of the stuff the app does is tied to interacting with that SVG, there’s no point in using a native toolkit, when most of it will be spent in the same WebKit anyway.

                                                          We could, of course, build our own widgets instead of using SVGs, but that’s way more time investment than we can afford. We - well, I - explored the native options. None of them would’ve allowed me to build the app as it is today. Electron did.

                                                          Sometimes there are good reasons for using Electron.

                                                          1. 1

                                                            not svgs, but the tk vector canvas is surprisingly capable and nice to use.

                                                          2. 12

                                                            Honestly, I have a dim view of cross-platform toolkits having used them and developed on them. UX-wise, they’re about as bad mouthfeel-wise as Electron. I had to do quite a bit of work to get Qt to have not awful mouthfeel on Mac OS. I find most of the advocates of cross-platform UI toolkits tend to be on Linux, which was historically a pretty low bar UX-wise and clamouring for any application. You’d get better performance, but it’s not a strong argument from the UX side.

                                                            1. 6

                                                              Honestly, in my experience they’re worse than Electron apps. At least standard text input shortcuts work in Electron! The “cross-platform” toolkits tend to look non-native, just like an Electron app (although often more dated), and have very… weird shortcut support, e.g. macOS Emacs-style keyboard input.

                                                            2. 8

                                                              What would you recommend? I don’t mean this adversarially, it’s just that every time I’ve looked for a good cross-platform GUI toolkit, I’ve come back disappointed. I hate working with Qt because Qt bindings vary in quality across languages and I’d rather not use Qt’s stdlib over the C++ stdlib when writing C++ because I have much more experience with the C++ stdlib. Gtk similarly has some pretty poor bindings in certain languages. Tk is probably the toolkit I’ve enjoyed using the most, but it’s rapidly losing mindshare from what I can tell.

                                                              1. 2

                                                                I agree with you that the state of cross-platform GUI toolkits is bad. I love GTK on Linux, and as far as I can tell, its language bindings are consistently good, even when they’re third-party. But GTK support on Windows is second-class, and on MacOS has historically been terrible (but is maybe getting better?).

                                                                When I was looking at a toolkit to use for a cross-platform graphical Common Lisp app, the best I could find was Tk, despite its limitations.

                                                              2. 4

                                                                I think so? There are options you can use, but there are no really good options. https://blog.royalsloth.eu/posts/sad-state-of-cross-platform-gui-frameworks/ is a nice survey.

                                                                1. 2

                                                                  They missed some third-party XAML implementations like https://avaloniaui.net/ It’s going to be closer to javafx, but with a great RAD environment (visual studio)

                                                                  I hope MAUI will get a community Linux back-end. That would make it a good alternative too.

                                                                2. 4

                                                                  i mean you have to buy into the react paradigm but react native can compile to windows and mac in addition to ios and android

                                                                  https://microsoft.github.io/react-native-windows/

                                                                  1. 2

                                                                    I guess people really haven’t tried how fast you can get stuff running with QT. Yeah it’s not completely native (and it can also be used the electron way since some version), but that’s not something you get with electron either. To be fair, you have to use c++ (with QT additions) or python for it..

                                                                    1. 2

                                                                      I inherited a Qt project once. It was awful. I’ve never used Electron, but I know enough about it to pick it over Qt in most circumstances.

                                                                      Not sure there are many other options if you’re targeting desktop. Proton looks promising. Microsoft’s React Native for Windows and Mac does as well. Both are similar concepts with ostensibly less overhead than Electron. Anyone here try those?

                                                                    1. 10

                                                                      I use mailmate for osx. not what i’d call a beautiful app but it’s lightning fast for search and sort over many accounts which is important to me.

                                                                      1. 13

                                                                        Because some Gems have become unfathomably broken and starting from a clean slate is the only thing that seems to work. I’d say I’ve had to do it a good 5 times.

                                                                        1. 3

                                                                          Ah, that may be one reason people are trying to uninstall Ruby.

                                                                          1. 3

                                                                            Yeah as a casual Ruby user who has had to touch it a few times for work I’ve ended up having to nuke my install a few times once things got irreparably screwed up

                                                                            1. 3

                                                                              if you update your system beyond what the native C extensions to the gem that were compiled to the system expect you have to rebuild the gems again… that’s a very common thing in ruby and not really the fault of ruby at all. the price of admission to have native extensions. I expect python to have a similar issue. ruby probably needs to be reinstalled too come to think of it since that’s built expecting some native libraries to be there.

                                                                            1. 7

                                                                              I’ve been looking for good cross-platform FOSS alternatives to GitHub tools or VS Code for pretty git interfaces, and gitui is the winner for me so far. It’s definitely made it easier for me to manage git repos even with its incomplete feature set, and as this release demonstrates it is quickly gaining functionality, making it even more pleasant to use.

                                                                              I will mention a specific pain point for me: gitui supports creating tags and pushing tags, but it doesn’t appear to support annotating tags. For git commits it supports opening the commit message in your editor if you want to write more than one line, why not do something similar for annotating tags?

                                                                              1. 4

                                                                                i don’t know if you’ve tried magit but it is hands down the most phenomenal way to use git in my opinion. downside is that you have to use emacs but you could probably tie it to a pared down version of it which i might just try to get going this weekend. despite it being tied to emacs it’s well worth the time to load up and use it. spacemacs has a decently polished layer that includes magit and vim customizations that make it all work well together.

                                                                                1. 7

                                                                                  gitui does not force any particular text editor on you 👍

                                                                                  1. 2

                                                                                    Neither does magit, in fairness, except for the editing of commit messages. And even then, you can use vi keybindings.

                                                                                    I intend no snark by pointing this out; I have colleagues who used other editors and only touched Emacs for magit.

                                                                                    That said, it’s great to see a good GUI for Emacs building momentum. I’ve seen so many new and junior Devs utterly confused by Git. (This is in part to do with how it’s usually taught, but also that the CLI is IMO quite confusing to learn).

                                                                                    1. 2

                                                                                      How is this a “good GUI”? It looks like an IBM CICS application for a bank backend.

                                                                                      1. 3

                                                                                        Didn’t you hear? The future of developer UIs is ncurses stomping on a human face, forever.

                                                                                        1. 2

                                                                                          I’m still holding out for a gesture-based interface to Git.

                                                                                          They’d all be rude gestures, mind you ;)

                                                                                      2. 1

                                                                                        it’s great to see a good GUI for Emacs building momentum

                                                                                        gitui is not “for” emacs. its a general terminal application

                                                                                        1. 1

                                                                                          Ah, braino. I meant “for git” :-/

                                                                                      3. 1

                                                                                        calling emacs a text editor is a bit generous ;)

                                                                                    2. 3

                                                                                      Hi glad you like it! I never annotated a tag 🙈 but it sounds like a reasonable feature request, please file it over on github👍

                                                                                      1. 2

                                                                                        Done :)

                                                                                    1. 3

                                                                                      Not sure if posting this fits the rules, but I semi accidentally stumbled upon this a while ago, and it markedly improved my life, so I figured it might be useful to share :)

                                                                                      1. 1

                                                                                        how does it compare to Magit?

                                                                                        1. 2

                                                                                          I am not a very heavy magit user, but, for the features I use (staging in chunks, instant fixup, reword, etc) it feels surprisingly close. Before this, I had an mg shell command which fired up Emacs+magit when I wanted to do git stuff. Now I do all that from VS Code without a context switch.

                                                                                          Interactive rebase is a bit more clunky than in Emacs though. On the positive side, g is mostly not needed any more, the state updates reactively.

                                                                                          1. 2

                                                                                            it’s like most vim emulators in other editors… it works mostly but there are a ton of annoyances that irritate

                                                                                        1. 29

                                                                                          I love Postgresql, and I’m really grateful for posts like this to balance my opinion and present a well-argumented counter-argument. However, when I read posts like this I mention a pattern: all these downsides seem to be relevant to really huge, perfomance-sensitive projects with enormous loads. The kind of projects where you likely have over a hundred of developers, and probably should move away from one master relational database to micro-services and message queues as a backbone of your architecture.

                                                                                          What I’m saying, this kind of criticism just highlights the fact that Postgresql is probably the best choice if you’re smaller than that, both in terms of load and team size.

                                                                                          1. 19

                                                                                            I almost hit the XID wraparound (I was 2-3 days from an outage; it was bad enough that AWS emailed me) when my company only had 4-5 devs and 100 customers. And I’ve hit connections-related performance issues at least four or five times through the last five years, at relatively modest scale (<100 application servers, in an overwhelmingly read-heavy workload). This affected us as recently as yesterday, as we are bringing a Timescale DB (which is a Postgres extension) into production and we are faced with the prospect of tiered pgBouncers or breaking the Timescale access into its own microservice.

                                                                                            I love Postgres but these are real and they can hit earlier than you expect.

                                                                                            1. 4

                                                                                              I love Postgres, and I was strongly considering moving to it…but for our use case, it simply requires too much care and feeding. We ship databases to customers in appliance form, meaning all the maintenance has to be invisible and automatic and Postgres simply isn’t there.

                                                                                              1. 6

                                                                                                Having worked for a company that did that and been responsible for Postgres tuning, I say it can be done. In nearly 15 years of shipping out a postgresql db as part of an appliance, I have not seen any of these problems.

                                                                                                Edit: Except for long upgrade times. That one is a PITA.

                                                                                                JADP.

                                                                                                1. 4

                                                                                                  I’d love to hear about your experience if you have time.

                                                                                                  Also, I’m drawing a blank on “JADP”…

                                                                                                  1. 3

                                                                                                    Just Another Data Point?

                                                                                                    1. 1

                                                                                                      Just A Data Point. A weird acronym I picked up from old-timey online fora like USENET, and The Well.

                                                                                                      I probably can’t say too much more about my experience postgres tuning as.

                                                                                                      1. It was for a company, and might be considered propietary information.
                                                                                                      2. It was about 5 years ago and I really don’t recall all that well what I did.

                                                                                                      sorry, just know that these are really rare problems if you’re dealing with the limited scale inherent in incorporating postgresql as part of an appliance. Most of them deal with syndication, or ginormous tables. They’re web-scale problems, not appliance scale problems

                                                                                                  2. 2

                                                                                                    what do you use instead?

                                                                                                    1. 1

                                                                                                      What are you planning on using instead?

                                                                                                      1. 1

                                                                                                        I do this as well. There’s definitely a discovery period but I’ve reached the point that I almost never have to check anything on the database side for roughly 200 customers, running varying versions from 9.6 to 11.9.

                                                                                                      2. 4

                                                                                                        Definitely echo that these problems (and others) can hit you way before you get to 100 devs. We were running into the pains mentioned in this article (which admittedly is a more general crritique of SQL databases, and lands on MySQL over Postgres) at more like 10 developers.

                                                                                                        It absolutely isn’t that hard to run into the pitfalls of SQL databases at relatively small scale, especially if you’re using them for OLTP workloads in services where uptime/response times matter.

                                                                                                      3. 5

                                                                                                        all these downsides seem to be relevant to really huge, perfomance-sensitive projects with enormous loads. The kind of projects where you likely have over a hundred of developers

                                                                                                        A number of these issues affect “normal” users of PostgreSQL as well:

                                                                                                        • Replication is something you may want even on smaller use cases.

                                                                                                        • “Wasted” space from the “update is really delete + insert”-paradigm can be a problem even on fairly small use cases (i.e. tens of millions of rows). It can make some simple operations rather painful.

                                                                                                        • Lack of query hints is pretty annoying, especially for smaller users who don’t have a dedicated DBA with a Ph.D. in the PostgreSQL query planner. It’s also a massive help in development; want to try a new index? Now it’s a drop index, create index, wait, analyse`, wait some more, run some queries, discover that didn’t do what you expected, drop the index, create a different one, wait, etc. It’s very time-consuming and much of the time is spent waiting.

                                                                                                        1. 5

                                                                                                          Nice example: “complaining” that it is hard to tune it for a million concurrent connections.

                                                                                                          Haven’t read it to the end yet, almost hoping to see an ending like “of course I’m happy to have a free DB that gets me in trouble for a million concurrent connections instead of breaking my bank at 1000 connections or when somebody touches advanced debugging like Oracle or

                                                                                                          1. 5

                                                                                                            FYI you should have read it through to the end, as the article does end on that note.

                                                                                                        1. 2

                                                                                                          I added a feature to firefox that I wanted. find a bug that is small in scope and hopefully has a mentor program available. most well designed open source stuff should have mostly compartmentalized code so just keep digging into the subsystems until you find out what is responsible for what.

                                                                                                          1. 6

                                                                                                            I like it.

                                                                                                            This general space (maybe “reheating cold context”?) has been interesting to me (read: my achilles’ heel?) for a while.

                                                                                                            Things I already do or have done:

                                                                                                            • open a terminal tab for a distinct project (sometimes more than one, for distinct sub-tasks/sub-projects)
                                                                                                            • keep tabs around for ongoing but inactive projects, so that I can review what I was doing
                                                                                                            • working on a project-oriented shell-history module to help sand down some rough edges for the above
                                                                                                            • working on an ST3 extension to sand down some sharp edges around ST3 projects (group multiple to open/close them together; have a persistent list of these meta projects that won’t get scrolled off of the recent-project list each time I open a bunch of related work projects…)

                                                                                                            I’ve also daydreamed about:

                                                                                                            • some sort of editor plugin/extension that keeps a contextual log of what you’ve been touching
                                                                                                            • some affordance for annotating shell history, and probably for grouping+annotating common command sequences (probably eventually part of or paired with the shell-history module) that (ideally) does things like:
                                                                                                              • passively notice common patterns and prompt me to annotate them (I notice you run these 4 commands in this order a lot; would you like me to help you annotate it, create a shortcut (script? function? alias?) and remind you about it when I see you manually run the commands?)
                                                                                                              • make it easy to see annotations + context (frequency, location, project, etc) by command/directory/project/etc.
                                                                                                              • maybe notice when I’m fumbling around with a command (you probably don’t need two guesses :)
                                                                                                              • maybe append/prepend/wrap/annotate the syntax help or manpage with my own invocations
                                                                                                            1. 12

                                                                                                              I am a bash history junkie somehow; I’d rather have one-liners in my history when I notice they are long but simple to come up with (e.g. find usages with several options). That means I don’t need to pollute $PATH with writable directories in order to reach these commands from the current working directory.

                                                                                                              So, far from being an automated process, when I notice I will need to run my-lengthy-one-liner more than once over the next couple of hours, I annotate them like this:

                                                                                                              : mnemonic ; my-lengthy-one-liner
                                                                                                              

                                                                                                              Then I can search for mnemonic on my shell history anytime I want to use that command.

                                                                                                              1. 2

                                                                                                                Oh, wow, that’s brilliant, thanks for sharing!

                                                                                                              2. 2

                                                                                                                Some useful tips there. I also keep tabs around (browser and terminal).

                                                                                                                Terminal: it certainly helps being able to rename the title so context shows up in the tab. There is also a way to add colour to iTerm2 tabs for almost a tag system. 1

                                                                                                                Browser-wise I use Tree-Style Tabs which allows me to set a project “parent” tab, say the git repo, and then collapse it’s children when I’m not working on it.

                                                                                                                As for shell history, I often find myself doing things along the lines of

                                                                                                                % command -with weird -flags i -wont remember # some additional context here about what I’m doing so all my notes get written to my eternal shell history (which is also in git)
                                                                                                                
                                                                                                                1. 2

                                                                                                                  maybe notice when I’m fumbling around with a command (you probably don’t need two guesses :)

                                                                                                                  perhaps you want one or both of tldr and thefuck?

                                                                                                                  brew install tldr

                                                                                                                  https://github.com/nvbn/thefuck

                                                                                                                1. 4

                                                                                                                  i’m surprised nobody is talking about magit. it’s quite powerful and easy to use. hands down the best gui for git that i’ve seen and it’s pretty accessible to the vim crowd if you use something like spacemacs.

                                                                                                                  1. 3

                                                                                                                    I’m curious if one could achieve similar results by blowing air in through the hinge (where the vents are located). But then you’d miss out on the satisfaction of seeing those squeeky clean fans at the end.

                                                                                                                    1. 2

                                                                                                                      I would think that might cause the fans to spin. I seem to recall hearing somewhere that this can be a bad thing, since it might damage the fans (somehow? maybe my spinning them in the wrong direction, or at an RPM that is too high?), but maybe that was just some unfounded rumor?

                                                                                                                      1. 3

                                                                                                                        Ah, I didn’t mention this in my post. I’ve read similar concerns that making the fans spin at too high of a RPM can damage them. I don’t know how valid the concern is, but just in case, I did use a toothpick to stop the fans from spinning while I used the compressed air to clean them.

                                                                                                                        1. 1

                                                                                                                          It depends on the machine. I doubt it’d be a problem on Macs because the Apple Tax allows them to cut fewer corners than a budget box, but (AFAIK, IANAEE etc) the issue is that you generate voltage in the motors of things like fans or 3d printers by moving parts around via external force, and this can hurt (sensitive | cheap | poorly isolated) circuitry.

                                                                                                                          1. 1

                                                                                                                            Yeah i would not spin the fans up… overspeeding them has caused mine to not sound good a while back so now i just hold them stationary while using the air… seems to work much safer. also, considering a fan is basically a generator in reverse i would think it could create some overvoltage on the board? Maybe apple thought of that too?

                                                                                                                            1. 2

                                                                                                                              I remember a buddy of mine who fried his PC mainboard by using compressed air from a generator to remove dust.

                                                                                                                              1. 2

                                                                                                                                Though I have no doubt this could happen, I cleaned out an old ThinkPad T61 with a leaf blower and it continued to run well for 3 more years.

                                                                                                                                1. 1

                                                                                                                                  Might’ve been around 2005 or earlier. They probably have circuitry now that can prevent this kind of damage now that hasn’t been available in cheap motherboards from yesteryear.

                                                                                                                                  1. 1

                                                                                                                                    Compressed air from a generator normally has condensation that shows up at the destination side as water vapor condensed onto the pcb. Which probably means you can end up shorting things.

                                                                                                                                    Compressed air is the best option, you can’t really protect against bridging circuits outside of the pcb.

                                                                                                                                    The leaf blower probably just didn’t condense air, not something I would personally use. Seems too good a way to let the magic smoke out of circuits.

                                                                                                                        1. 4

                                                                                                                          What am I supposed to be seeing here that I am not?
                                                                                                                          The page is just a perspective-skewed screenshot and the message

                                                                                                                          Replay is an early experiment. We’ll let you know on @FirefoxDevTools when it’s ready for input.

                                                                                                                          I can make some guesses from the screenshot (the words “Paused in Recording”), but there’s no explanation what the “early experiment” even is. There is a link to @FirefoxDevTools on Twitter but it doesn’t mention Replay in any recent posts.

                                                                                                                          1. 4

                                                                                                                            yes there was more info before but it’s a debugging replay tool:

                                                                                                                            https://web.archive.org/web/20191128111509/https://firefox-replay.com/

                                                                                                                            1. 3

                                                                                                                              I think someone found a page in testing and linked it here.

                                                                                                                              To my knowledge, Firefox Replay is rr, but for the web.

                                                                                                                              1. 1

                                                                                                                                It’s probably a debugging tool that records what happens in the background to replay later on and dive deeper into code execution?

                                                                                                                                1. 2

                                                                                                                                  That’s my best-guess assumption. I was wondering why this has so many upvotes for a zero-information page that isn’t even a release announcement. Since I can’t downvote (only flag, which seems wrong), figured I would ask.

                                                                                                                                  At this point I figure perhaps they changed the page since it was posted (as of writing this, 7 hours ago)?

                                                                                                                                  1. 4

                                                                                                                                    When it was posted the site had more content, yes.

                                                                                                                                    1. 1

                                                                                                                                      Yeah, there’s an archive.org link elsewhere in the thread which represents what was actually on the page at the time it was posted.