66 Matching Annotations
  1. Nov 2023
  2. Oct 2023
  3. Sep 2023
    1. Root directories are recommended not to be nested; however, Zeitwerk provides support for nested root directories since in frameworks like Rails, both app/models and app/models/concerns belong to the autoload paths. Zeitwerk identifies nested root directories and treats them as independent roots. In the given example, concerns is not considered a namespace within app/models. For instance, consider the following file: app/models/concerns/geolocatable.rb should define Geolocatable, not Concerns::Geolocatable.
  4. Jul 2023
    1. There, the module object stored in MyDecoration by the time the initializer runs becomes an ancestor of ActionController::Base, and reloading MyDecoration is pointless, it won't affect that ancestor chain.
  5. Jun 2023
    1. If I continue the conversation after I create a shared link, will the rest of my conversation appear in the shared link?No. Think of a shared link as a snapshot of a conversation up to the point at which you generate the shared link. Once a shared link is created for a specific conversation or message, it will not include any future messages added to the conversation after the link was generated. This means that if you continue the conversation after creating the shared link, those additional messages will not be visible through the shared link.
  6. Nov 2022
    1. Remember there are two kinds of variable. Internal Variables and Environment Variables. PATH should be an environment variable.

      In my case, I was trying to debug which asdf not finding asdf, in a minimal shell.

      I had checked bash-5.1$ echo $PATH|grep asdf /home/tyler/.asdf/bin

      but ```

      The PATH environment variable

      env | /bin/grep PATH `` being empty was the key discovery here. Must have forgotten theexport`.

    2. All shells should tell you that your path is the same thing with BOTH of the two commands: # The PATH variable echo "$PATH" # The PATH environment variable env | /bin/grep PATH
    1. The first decision point is about whether the party that requires access to resources is a machine. In the case of machine-to-machine authorization, the Client is also the Resource Owner, so no end-user authorization is needed.
  7. Sep 2022
  8. Apr 2022
    1. By default, app/models/concerns belongs to the autoload paths and therefore it is assumed to be a root directory. So, by default, app/models/concerns/foo.rb should define Foo, not Concerns::Foo.
    1. Will be executed right after outermost transaction have been successfully committed and data become available to other DBMS clients.

      Very good, pithy summary. Worth 100 words.

      The first half was good enough. But the addition of "and data become available to other DBMS clients" makes it real-world and makes it clear why it (the first part) even matters.

    2. after_commit { puts "We're all done!" }

      Notice the order: this is printed last, after the outer (real) transaction is committed, not when the inner "transaction" block finishes without error.

    3. We're all done!

      Notice the order: this is printed last

  9. Jan 2022
    1. Code that is per-component instance should go into a second <script> tag.

      But this seems to conflict with https://hyp.is/NO4vMmzVEeylBfOiPbtB2w/kit.svelte.dev/docs

      The load function is reactive, and will re-run when its parameters change, but only if they are used in the function.

      which seems to imply that load is not just run once for the component statically, but rather, since it can be reactive to:

      url, params, fetch, session and stuff

      may be sufficiently like a per-instance callback, that it could be used instead of onMount?

  10. Nov 2021
  11. Oct 2021
    1. It is very important to understand that Ruby does not have a way to truly reload classes and modules in memory, and have that reflected everywhere they are already used. Technically, "unloading" the User class means removing the User constant via Object.send(:remove_const, "User").
  12. Aug 2021
    1. Also note thet width: 100% is relative to it's first parent with a layout. So if you have an element with width:100% inside another element that has a specific width, the child element will only take up the total width of that parent.
  13. Jun 2021
    1. -- The array on the right side is not considered contained within the -- array on the left, even though a similar array is nested within it: SELECT '[1, 2, [1, 3]]'::jsonb @> '[1, 3]'::jsonb; -- yields false -- But with a layer of nesting, it is contained: SELECT '[1, 2, [1, 3]]'::jsonb @> '[[1, 3]]'::jsonb;
    1. We need to be really careful about what's 'same origin' because the server has no idea what host/path the various cookies are associated with. It just has a list of cookies that the browser had determined to be relevant for this SSR'd page, and not for any other subrequests.
  14. Apr 2021
  15. Mar 2021
    1. Dictionary writers list polysemes under the same entry; homonyms are defined separately.

      This describes how you can tell which one it is by looking at the dictionary entry.

    2. Polysemy is thus distinct from homonymy—or homophony—which is an accidental similarity between two words (such as bear the animal, and the verb to bear); while homonymy is often a mere linguistic coincidence, polysemy is not.
    1. Generally, CSS selectors refer to markup or, in some cases, to element properties as set with scripting (client-side JavaScript), rather than user actions. For example, :empty matches element with empty content in markup; all input elements are unavoidably empty in this sense. The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value. And :checked and :indeterminate are similar things. They are not affected by actual user input.
    2. The selector [value=""] tests whether the element has the value attribute in markup and has the empty string as its value.
  16. Feb 2021
    1. Using Track() with a new track semantic only makes sense when using the [:magnetic_to option] on other tasks.
    1. If any of the inputs are invalid, #execute won't be run.

      It does staged/pipelined execution/validation.

      If any of these stages has any errors, then no other stages will be executed:

      1. validations on the inputs of the interaction itself
      2. run execute, which may:
      3. may use compose, which will (IIUC) abort the entire execute/run early if any of them fail, even if there are later composed interactions still to be run
      4. may try to save inputs into models, which themselves may have validation errors, which (assuming we use errors.merge), will show up on the interaction.errors (but won't abort the rest of the execute)
    2. There are times where it is useful to know whether a value was passed to run or the result of a filter default. In particular, it is useful when nil is an acceptable value.

      Yes! An illustration in ruby:

      main > h = {key_with_nil_value: nil}
      => {:key_with_nil_value=>nil}
      
      main > h[:key_with_nil_value]
      => nil
      
      main > h[:missing_key]  # this would be undefined in JavaScript (a useful distinction) rather than null, but in Ruby it's indistinguishable from the case where a nil value was actually explicitly _supplied_ by the caller/user
      => nil
      
      # so we have to check for "missingness" ("undefinedness"?) differently in Ruby
      
      main > h.key?(:key_with_nil_value)
      => true
      
      main > h.key?(:missing_key)
      => false
      

      This is one unfortunate side effect of Ruby having only nil and no built-in way to distinguish between null and undefined like in JavaScript.

    3. When you run this interaction, two things will happen. First ActiveInteraction will type check your inputs. Then ActiveModel will validate them. If both of those are happy, it will be executed.

      Failed type checks generate run-time errors. So it's up to the develop to fix these, permanently, since the user can't (99% of time) do anything to fix these.

      Failed validations add errors to interaction.errors object. These are for the user to fix.

  17. Jan 2021
    1. Blocks Don’t Need 100% Width When we understand the difference between block-level elements and inline elements, we’ll know that a block element (such as a <div>, <p>, or <ul>, to name a few) will, by default expand to fit the width of its containing, or parent, element (minus any margins it has or padding its parent has).
  18. Nov 2020
    1. this in particular comes from the addressee

      I think the ruling's main point/distinction here is that while submitting a form might be getting consent from the addressee (the person submitting form might be the addressee, if they own the e-mail address they entered), but we can't know that for sure until they confirm by clicking a link in the e-mail.

      Only then do we know for sure that the actor submitting the form was the addressee and that the consent ostensibly received via the form was in fact from the addressee. But it could otherwise be the case that they entered someone else's address, and you can't give consent on behalf of someone else!

  19. Oct 2020
    1. For performance reasons, $: reactive blocks are batched up and run in the next microtask. This is the expected behavior. This is one of the things that we should talk about when we figure out how and where we want to have a section in the docs that goes into more details about reactivity. If you want something that updates synchronously and depends on another value, you can use a derived store:
    1. The clean-up function runs before the component is removed from the UI to prevent memory leaks. Additionally, if a component renders multiple times (as they typically do), the previous effect is cleaned up before executing the next effect. In our example, this means a new subscription is created on every update.
    1. The readable store takes a function as a second argument which has its own internal set method, allowing us to wrap any api, like Xstate or Redux that has its own built in sub­scrip­tion model but with a slightly different api.
  20. Sep 2020
    1. Auto-subscription only works with store variables that are declared (or imported) at the top-level scope of a component.
    1. feel like there needs to be an easy way to style sub-components without their cooperation
    2. The problem with working around the current limitations of Svelte style (:global, svelte:head, external styles or various wild card selectors) is that the API is uglier, bigger, harder to explain AND it loses one of the best features of Svelte IMO - contextual style encapsulation. I can understand that CSS classes are a bit uncontrollable, but this type of blocking will just push developers to work around it and create worse solutions.
    1. Notice that all tags start with a lower case letter. This is different to other NativeScript implementations. The lower case letter lets the Svelte compiler know that these are NativeScript views and not Svelte components. Think of <page> and <actionBar> as just another set of application building blocks like <ul> and <div>.
  21. Aug 2020
    1. Co-hyponyms are labelled as such when separate hyponyms share the same hypernym but are not hyponyms of one another, unless they happen to be synonymous
    1. Note that the double quotes around "${arr[@]}" are really important. Without them, the for loop will break up the array by substrings separated by any spaces within the strings instead of by whole string elements within the array. ie: if you had declare -a arr=("element 1" "element 2" "element 3"), then for i in ${arr[@]} would mistakenly iterate 6 times since each string becomes 2 substrings separated by the space in the string, whereas for i in "${arr[@]}" would iterate 3 times, correctly, as desired, maintaining each string as a single unit despite having a space in it.
  22. May 2020
    1. It may be the case that several sufficient conditions, when taken together, constitute a single necessary condition (i.e., individually sufficient and jointly necessary)