133 Matching Annotations
  1. Oct 2024
    1. This is a bit awkward since TypeScript already defines its own thing called Iterator purely for type-checking. So due to this unfortunate name clash, TypeScript needs to introduce a separate type to describe these native/built-in iterable iterators.
    1. The extension runs a command using your shell’s interactive mode, so that version managers configured in files such as ~/.zshrc are picked up automatically. The command then exports the environment information into JSON, so that we can inject it into the NodeJS process and appropriately set the Ruby version and gem installation paths.

      Makes sense, but some of these solutions sure seem like roundabout/unideal solutions

  2. Sep 2024
  3. Feb 2024
    1. As you've seen, there is no DM system, but you can invite users to chat directly. More generally, consider commenting on the question itself and @-ing the user who made the edit(s). To my understanding, this should work, and it may allow for a quick explanation that doesn't require going in to chat.

      I think commenting in the context of question is better than a DM, though I don't always like making my question "messy" by having a bunch of comments under it... but maybe that is the best way.

  4. Jan 2024
    1. he wife considers her husband to be heaven

      superiority !!

    Tags

    Annotators

    1. Some frameworks call this “template inheritance”. In this example, we might say that the application layout “inherits from” or “extends” the base layout. 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. But what if you want to reuse one layout within another?
    1. aujourd'hui l'idéal républicain et cet idéal il est en 00:05:45 grande partie fondé sur un système scolaire se voulant méritocratique
  5. Nov 2023
  6. Sep 2023
  7. Aug 2023
    1. I ran into the same problem and never really found a good answer via the test objects. The only solution I saw was to actually update the session via a controller. I defined a new action in one of my controllers from within test_helper (so the action does not exist when actually runnning the application). I also had to create an entry in routes. Maybe there’s a better way to update routes while testing. So from my integration test I can do the following and verfiy: assert(session[:fake].nil?, “starts empty”) v = ‘Yuck’ get ‘/user_session’, :fake => v assert_equal(v, session[:fake], “value was set”)
    1. I make a file named: app/models/active_storage/attachment.rb. Because it's in your project it takes loading precedence over the Gem version. Then inside we load the Gem version, and then monkeypatch it using class_eval: active_storage_gem_path = Gem::Specification.find_by_name('activestorage').gem_dir require "#{active_storage_gem_path}/app/models/active_storage/attachment" ActiveStorage::Attachment.class_eval do acts_as_taggable on: :tags end The slightly nasty part is locating the original file, since we can't find it normally because our new file takes precedence. This is not necessary in production, so you could put a if Rails.env.production? around it if you like I think.
  8. Jun 2023
  9. Nov 2022
  10. Oct 2022
  11. Jul 2022
    1. The ‘ideal’ is nothing other thana representation of social conditioning and the installation of a personware module into the newbornhuman that tries to accord what is with what the social system projects. We acknowledge of course thatsome mediation is always needed. The baby sees the world and the social world in particular throughthe eyes of the parent and only afterwards autonomously. This mediation is crucial to the cognitivedevelopment of the person and cannot happen without a personware. But the personware can beconstructed such that it empowers the individual and does not subjugate it to the social demands.

      !- definition : good enough * From Donald Winnicot, a parent who is "good enough" is actually healthier for the child than the standard "ideal" parent. * A "good enough" parent does not force the child to choose between two aspects of wellbeing, both of which are necessary.

  12. Apr 2022
    1. There are ways to create aspect-ratio sized boxes in HTML/CSS today. None of the options are particularly elegant because they rely on the “hack” of setting a zero height and pushing the boxes height with padding. Wouldn’t it be nicer to have a platform feature to help us here?
  13. Mar 2022
    1. They claim that they deduplicate runtimes. I question how much can really be shared between different branches when everything is recompiled. How much has /usr changed between releases of Ubuntu? I would guess just about all of it.
  14. Nov 2021
  15. Oct 2021
    1. while with server/externalFetch there is no direct way to pass cookie headers from the original request to the external one
    2. Right now I am working around this issue by having an internal [...api].js, then call fetch for that endpoint (which automatically passes on cookies) and from there hit the actual external endpoint. It works, there is no risk of leaking anything, but imo shouldn't be necessary.
    3. I am currently circumventing this issue by using getSession to have access to the cookies/headers in the load method

      We did something similar for a while...

    4. that is not ideal, since for example 'Cookie' is a forbidden header name, so I have to start worrying about env in load, which is kind of contra to its design.
  16. Aug 2021
    1. With JavaScript, you can actually calculate the width of the scrollbar and whether it’s visible by comparing two properties—window.innerWidth and document.body.clientWidth. If these are equal, the scrollbar isn’t visible. If these are different, we can subtract the body width from the window width to get the width of the scrollbar:const scrollbarWidth = window.innerWidth - document.body.clientWidthWe’ll want to perform this both on page load and on resize, in case someone resizes the window vertically and changes the overflow. Then, once we have the scrollbar width, we can assign it as a CSS variable:document.body.setProperty("--scrollbarWidth", `${scrollbarWidth}px`)

      missing feature: vw/vh can't be used "directly" because doesn't account for scrollbars

    2. I know, I know—needing to use JavaScript when writing CSS does feel like defeat, but unless there’s a vwWithoutTheScrollbarPlease unit in CSS, you’re going to need use JavaScript.
    3. Maybe someday, we’ll get a viewport unit that doesn’t factor in the scrollbars, but until then, we can only work around the current one.
  17. Jul 2021
  18. Jun 2021
  19. Apr 2021
    1. First, no joypad support. It's not a big deal because you can still use big picture emulation or joy2key
    1. After some searching i found a stack overflow problem that didn't fix my issue but anyhow… I simply used a little ruby and the capybara library to find the field myself with some case insensitive regex and the ruby detect method
  20. Mar 2021
    1. If I were to sum up why in one sentence, it's because I don't miss useEffect. I understand why it exists, I understand the approach React takes, and there are benefits of its approach. But writing complex React components feels more like admin; a constant worry that I'll miss a dependency in my useEffect call and end up crashing my browser session. With Svelte I don't have that lingering feeling, and that's what I've come to enjoy.
    2. One gripe I've had with this approach is that you lose the visual cues that you're passing children into the Box component; they now aren't nested within the Box when you render them like we're used to in HTML; it's now up to you to read the props and spot which ones are being used to provide children.
    3. Here's where I start to have a preference for Svelte; the two are very similar but once I got used to Svelte I found that React felt like jumping through hoops. You can't create a worker instance, it has to go in a useRef, and then you can't easily pull code out into a function without then requiring useCallback so it can be a safe dependency on useEffect. With Svelte I write code that's closer to "plain" JavaScript, whereas in React more of my code is wrapped in a React primitive.
    4. because React components are re-executed every time the component re-renders, you can easily end up with thousands of workers being created! It's essential to use useRef to avoid this problem by maintaining a reference to the worker that you've created.
    1. If you really want this, I suggest you write a little function that extracts the executable name from the .desktop file and runs it. Add these lines to your shell's initialization file (e.g. ~/.bashrc): runDesktop () { eval "$(awk -F= '$1=="Exec"{$1=""; print}' "$1")" } Then, you can run your .desktop file with runDesktop ~/Desktop/slack.desktop
    1. A solution is almost indicated in the question: hinder xdg-open from choosing exo-open. A brute-force approach is to copy /usr/bin/xdg-open to /usr/local/bin (/usr/local/bin is earlier in PATH unless PATH has been modified) and to patch it to use open_generic instead of exo_open (unlike the XFCE4-specific exo-open, open_generic does honor xdg mime types)
    1. Dave Rupert has a good solution that uses an input's invalid event. Instead of using the :invalid pseudo selector, he adds a CSS class to the input when it becomes invalid. We will extend this approach by removing the CSS class when the element becomes valid again.
    1. Validating forms has notoriously been a painful development experience. Implementing client side validation in a user friendly, developer friendly, and accessible way is hard. Before HTML5 there was no means of implementing validation natively; therefore, developers have resorted to a variety of JavaScript based solutions.
    1. You need to create a copy of the method or the class of your callable task in order to fix this and have two identical steps.
  21. Feb 2021
    1. So how are we going to create a model that doesn’t have a database table behind it? There are several potential solutions including various plugins but we’re going to use the method described in an entry on the Code Tunes blog. This shows a techinque that involves overriding a couple of methods in an ActiveRecord model and then manually defining the columns in the model file rather than in the database table. In our Recommendation model we’ll add in the two overridden methods and then use the column class method to define the columns in a similar way to how they’re defined in a migration file.

      Does this still work in Rails 6? I wonder.

    1. With the introduction of CPUs which ran faster than the original 4.77 MHz Intel 8088 used in the IBM Personal Computer, programs which relied on the CPU's frequency for timing were executing faster than intended. Games in particular were often rendered unplayable. To provide some compatibility, the "turbo" button was added. Engaging turbo mode slows the system down to a state compatible with original 8086/8088 chips.
    1. There is nothing wrong with accepts_nested_attributes_for. This is what you should use in your typical case. My post describes a non-typical case. ContactListForm is not an ActiveRecord object, it is an object that includes ActiveModel::Model, which does not support accepts_nested_attributes_for.
    1. If you need your grid to utilize a gap between columns / rows, you won't be able to use the gap property when using this method. You'd instead need to resort to some negative margin manipulation to handle the extra gap space.
    1. I hope we see new CSS capabilities arise that allow this sort of effect without the need for trickery.
    2. Since CSS doesn’t (yet) offer a way to style grid cells, areas, or tracks directly, we have to stretch elements over the parts we want to style independently from the elements that contain content.
  22. Jan 2021
    1. https://github.com/sveltejs/svelte/issues/1037#issuecomment-737872461

      Explanation (from https://github.com/sveltejs/svelte/issues/1037#issuecomment-739458005):

      @AlexGalays register is an action created and passed in from the parent node (Wrapper) which allows the child to register with it. Not builtin to svelte.

      That's very clever @PatrickG. Nice one. I was a bit confused when first looking at it to understand what was going on, but I think that will be a handy tool in the toolbox.

      But why do we need this? If we remove all use:register, it still toggles just fine. Seems the only benefit is that this allows cleanup.

    1. Disk space is an issue. Resource usage is an issue. Those new packages nowadays need huge amount of storage to finally do the exact same thing as their older and lighter deb counterpart. Whatever the price of storage, it’s the opposite of a progress, it’s not optimal at all.
  23. Dec 2020
    1. Yarn only runs the postinstall hook after yarn and yarn add, but not after yarn remove. The postinstall-postinstall package is used to make sure your postinstall hook gets executed even after a yarn remove.
    1. It seems being able to bind:this={slotEl} directly on a slot element is a popular request. I'll add my +1 as adding div wrappers just to get dom references gets old really fast.
  24. Nov 2020
    1. # Run once, hold otherwise if [ -f "already_ran" ]; then echo "Already ran the Entrypoint once. Holding indefinitely for debugging." cat fi touch already_ran
    2. Edit this file (corresponding to your stopped container): vi /var/lib/docker/containers/923...4f6/config.json Change the "Path" parameter to point at your new command, e.g. /bin/bash. You may also set the "Args" parameter to pass arguments to the command. Restart the docker service (note this will stop all running containers):
    1. Thanks so much for the reply! Due to space limitations for comments, I have appended my reply to my original question. Thanks again! (P.S. I can't up-vote your reply until my rep hits 15... Sorry about that.)
    1. If this is getting implemented, I think I'll love to see both implemented. I can see a lot of use cases where I would like to encapsulate the component with additional wrappers and in another scenarios I would like to just use the component. Now i work around this using empty div but then at times it breaks the structure because of the div element and I'll have to add more class utilities to make it work. This will be a great addition for Svelte.
  25. Oct 2020
    1. Use the same value that was submitted, which ensures that a 'change' is triggered even though the value itself doesn't change. Therefore, the same value gets validated again.

      Calling it "change" even though it didn't change is kind of cheating/abuse ... but I guess it's okay...??

        mutateValue([name], state, { changeValue }) {
          // change the value to the same value, thus
          // triggering a revalidation of the same value
          changeValue(state, name, value => value);
        }
      
    1. Typically, platform accessibility APIs do not provide a vehicle to notify assistive technologies of a role value change, and consequently, assistive technologies may not update their cache with the new role attribute value.

      It's too bad they couldn't just allow role to be changed, and assistive technologies would just have to be updated to follow the suit.

  26. Sep 2020
    1. Also, I'm starting to wonder if maybe it's okay to have multiple spreads? If the alternative to <Foo {...a} {...b} {...c} d={42}> is that people will write <Foo {...Object.assign({}, a, b, c)} d={42}> anyway, then do we gain anything with the constraint?
    1. Force everything to the git root per NPM lameness
    2. For a non-monorepo package you can simply point directly to the Github repo. This case is similar, but you want to scope it just to a single package within the repo. For those that make monorepos they don't necessarily need this feature. It's for those that use projects that use monorepos. Telling them to not organize their projects into monorepos doesn't help people who make use of these projects.
    3. npm's inability to handle monorepos then i'd have designed my repos accordingly
  27. Aug 2020
    1. I could add .json on the end, but that would mean hacking away at angularjs, which is doing the right thing. I would rather find a good solution and hack away at rails, which is doing the wrong thing :)
    2. In that case I would suggest to use .xml or .json format to eliminate accept header parsing issue.

      Avoid using a perfectly good feature (accept header negotiation) just because browsers screwed things up?

    3. Safari sends following order application/xml (q is 1) application/xhtml+xml (q is 1) image/png (q is 1) text/html (q is 0.9) text/plain (q is 0.8) \*/\* (q is 0.5) So you visit www.myappp.com in safari and if the app supports .xml then Rails should render .xml file. This is not what user wants to see. User wants to see .html page not .xml page.
  28. Jul 2020
    1. Creating and calling a default proc is a waste of time, and Cramming everything into one line using tortured constructs doesn't make the code more efficient--it just makes the code harder to understand.

      The nature of this "answer" is a comment in response to another answer. But because of the limitations SO puts on comments (very short length, no multi-line code snippets), comment feature could not actually be used, so this user resorted to "abusing" answer feature to post their comment instead.

      See

  29. May 2020
  30. Apr 2020
  31. 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!
  32. Dec 2019
    1. While I wanted to do my best to not judge how I was spending my time during the experiment—to just track it as it is and analyze at the end—I did want to have a baseline to compare my results to. This wasn't a hypothesis of how I spend my time, but more of a vision for how I would like my time to be allocated.
    1. This problem can also come up when you use npm link or an equivalent. In that case, your bundler might “see” two Reacts — one in application folder and one in your library folder. Assuming myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This should make the library use the application’s React copy.
  33. Nov 2019
  34. Aug 2019
    1. I was so fed up of the mega amounts of boilerplate with Redux and the recommendation of keeping your data loading at view level. It seems to me that things like this, with components being responsible for their own data, is the way to go in the future.
  35. Feb 2019
  36. Jan 2017
    1. Howeverfrequenttheireuphoricflightsabouttheunlim-itedpowersandmalleabilityofman,theyknewthatrhetoricaleducation,inpractice,sawmanaslimited,notunlimited,livinginaworldofplay,notofidealforms.

      If I'm reading this correctly, this is saying that to live in a world of ideal forms would be the less limiting option here. However, I usually consider ideal forms to be quite limiting as I generally understand idealism to be so closely aligned with essentialism. For example, when students are introduced to an "ideal argument," their notions of argument become more and more restricted. While this can be good (because it provides models for those beginning), it limits the possibilities of all of the divergent notions of argument.

      In the next paragraph, when Lanham says "when rhetoric empowers literature, it is unredeemable. That is what rhetorical literature, I am tempted to say Western literature, is all about," I jump back up here, and then back down there, and then back up here. I wonder if Lanham is suggesting something here about the essentialist notions of humanity... In other words, as long as advocacy for rhetoric carries the baggage of essentialism (like literature as always being boiled down to saying something about the human condition), it will never get beyond the weak defense?

  37. May 2015
    1. cannot be entirely explained by the Ideal Gas Law (or variations thereof) when applied to the most likely game conditions and circumstances

      How about when introducing a needle that registers .3-.45 below accurate. Start the ideal gas law tests at 12.05.

  38. Feb 2014
    1. We will construct a p ortrait of the \ideal mathematician". By this we do not mean the p erfect mathematician, the mathematician without de- fect or limitation. Rather, we mean to describ e the most mathematician- like mathematician, as one might describ e the ideal thoroughbred grey- hound, or the ideal thirteenth-century monk.
  39. Nov 2013
    1. "I teach," he says, "that the orator cannot be perfect unless he is a good man. Con-sequently I demand from him not only outstand-ing skill in speaking but all the virtuous qualities of character." This is the type of orator that Quin-tilian constructs for us. Afterwards in the twelfth book, where he defines him in similar terms as a good man skilled in speaking well, he identifies those virtuous qualities of character as justice, courage, self-control, prudence, likewise knowl-edge of the whole of philosophy and of law, a thorough acquaintance with history, and many other attributes worthy of praise.
  40. Oct 2013
    1. Such an orator ought now surely to be formed, when so many more examples of eloquence exist than fell to the lot of those who have hitherto been considered the best orators, for to them will belong the praise, not only of surpassing those who preceded them, but of instructing those who followed.

      Ideal orator

    1. We see an antidote, for example, and other medicines to heal diseases and wounds, compounded of many and sometimes opposite ingredients, from the various qualities of which results that single compound, which resembles none of them, yet takes its peculiar virtues from them all.

      Analogy of what makes a perfect orator.

    2. Nature does not forbid the formation of a perfect orator, and it is disgraceful to despair of what is possible.

      Ideal orator is attainable

    1. pervert the judge by moving him to anger or envy or pity -- one might as well warp a carpenter's rule before using it.

      The judge is only human, though - sometimes it seems like the Greeks' concept of achieving the ideal got in the way sometimes.