22 Matching Annotations
  1. Apr 2022
    1. In Rails, this is known as nested layouts, and it is a bit awkward to use. The standard Rails practice for nested layouts is complicated and involves these considerations:
  2. Mar 2022
    1. In 1994, The Unix-Haters Handbook was published containing a long list of missives about the software—everything from overly-cryptic command names that were optimized for Teletype machines, to irreversible file deletion, to unintuitive programs with far too many options. Over twenty years later, an overwhelming majority of these complaints are still valid even across the dozens of modern derivatives. Unix had become so widely used that changing its behavior would have challenging implications. For better
  3. Jan 2021
    1. In my opinion, it can sometimes look odd. Very interestingly, this is by design and is part of the Material design specification. This article isn’t to argue whether it should be this way or not, though; it’s just to change yours such that your MenuItem(s) show below the menu selection, like so:
  4. Sep 2020
  5. Jul 2020
    1. These seem to be better reasons to support sub-nanosecond resolution. I think either storing picoseconds or storing sec fraction as 64-bit integer are better approaches than storing a rational. However, either change would be very invasive, and it seems unlikely to be worth the effort.
    1. JSON parsing is always pain in ass. If the input is not as expected it throws an error and crashes what you are doing. You can use the following tiny function to safely parse your input. It always turns an object even if the input is not valid or is already an object which is better for most cases.

      It would be nicer if the parse method provided an option to do it safely and always fall back to returning an object instead of raising exception if it couldn't parse the input.

  6. Jun 2020
    1. However, a ActiveRecord::Rollback within the nested transaction will be caught by the block of the nested transaction, but will be ignored by the outer transaction, and not cause a roll back! To avoid this unexpected behaviour, you have to explicitly tell rails for each transaction to indeed use proper nesting: CopyActiveRecord::Base.transaction(joinable: false, requires_new: true) do # inner code end This is a safer default for working with custom transactions.
  7. May 2020
    1. the i18n object with all the strings

      They don't require supplying all keys for other objects that can be overridden, such as banner: the default value is used for whatever keys are not provided within the banner object. In other words, values are merged, with the supplied values overriding the defaults. The i18n object should work the same way. Often you only need/want to override a couple phrases/translations, not all of them.

      See: https://www.iubenda.com/en/help/1205-how-to-configure-your-cookie-solution-advanced-guide

    1. I dismissed the idea, though, because I thought that cloning even part of a repository with git-svn required scanning every commit in the entire repository, in order to build the local history. With almost 1.5 million commits in the plugin repository, that would take roughly 4 hours to clone a plugin.
  8. Mar 2020
    1. Ruby's current handling of Dates and Times is all over the map. We have Date, Time, DateTime, ParseDate, and more, not to mention all the other common extensions running around out there. Ruby needs an improved class that incorporates them all.
  9. Feb 2020
    1. The .ignore file , from what I can tell, needs to exist in the directory you're targeting for it to be recognized, not the current directory. If you're searching in .src, the file would need to be there for it to work.
  10. Jan 2020
    1. ssh doesn't let you specify a command precisely, as you have done, as a series of arguments to be passed to execvp on the remote host. Instead it concatenates all the arguments into a string and runs them through a remote shell. This stands out as a major design flaw in ssh in my opinion... it's a well-behaved unix tool in most ways, but when it comes time to specify a command it chose to use a single monolithic string instead of an argv, like it was designed for MSDOS or something!
  11. Dec 2019
    1. The Internet permission is only used to display the Google Map, which is only displayed once on creating a new location. Meaning, once you created all your needed locations, you can deactivate the Internet permission and still use the location based reminders (Note: Most devices don't allow you to revoke this permission, sorry).
    1. Directly on the Switch: Some third-party games including Fortnite and Overwatch don’t need a separate app. You just connect a standard headset to the single 3.5 mm audio jack on your Switch and chat without the app, just like a smartphone. Again, Nintendo’s own games won’t work with this.

      This seems like the obvious solution. Why would Nintendo make you get a separate app on a separate platform (Android) when they could just let you chat directly via the Switch device like these games do?

    1. The IdentitiesOnly yes is required to prevent the SSH default behavior of sending the identity file matching the default filename for each protocol. If you have a file named ~/.ssh/id_rsa that will get tried BEFORE your ~/.ssh/id_rsa.github without this option.
    1. Arguably, the rails-team's choice of raising ArgumentError instead of validation error is correct in the sense that we have full control over what options a user can select from a radio buttons group, or can select over a select field, so if a programmer happens to add a new radio button that has a typo for its value, then it is good to raise an error as it is an application error, and not a user error. However, for APIs, this will not work because we do not have any control anymore on what values get sent to the server.
  12. Nov 2019
  13. developer.mozilla.org developer.mozilla.org
    1. Using with is not recommended, and is forbidden in ECMAScript 5 strict mode. The recommended alternative is to assign the object whose properties you want to access to a temporary variable.