52 Matching Annotations
  1. Sep 2021
    1. Airtable evolves with you and your team, so you can build a solution with increasing sophistication and capability.
  2. Aug 2021
    1. We focus so much on black magic and avoiding it that we rarely have a chance to enjoy any of the benefits. When used responsibly and when necessary, it gives a lot of power and expressiveness.
  3. May 2021
    1. This allows you to modify response headers or bodies, or bypass SvelteKit entirely
    1. This allows you to have any sort of object as a prop (e.g. you could dynamically import a component inside load and use it with <svelte:component>).
  4. Apr 2021
  5. Mar 2021
    1. Or if you need to change the way the string is assembled, you can provide a proc, for example: if defined?(BetterErrors) BetterErrors.editor = proc { |file, line| "vscode://file/%{file}:%{line}" % { file: URI.encode_www_form_component(file), line: line } } end
  6. Feb 2021
    1. For branching out a separate path in an activity, use the Path() macro. It’s a convenient, simple way to declare alternative routes

      Seems like this would be a very common need: once you switch to a custom failure track, you want it to stay on that track until the end!!!

      The problem is that in a Railway, everything automatically has 2 outputs. But we really only need one (which is exactly what Path gives us). And you end up fighting the defaults when there are the automatic 2 outputs, because you have to remember to explicitly/verbosely redirect all of those outputs or they may end up going somewhere you don't want them to go.

      The default behavior of everything going to the next defined step is not helpful for doing that, and in fact is quite frustrating because you don't want unrelated steps to accidentally end up on one of the tasks in your custom failure track.

      And you can't use fail for custom-track steps becase that breaks magnetic_to for some reason.

      I was finding myself very in need of something like this, and was about to write my own DSL, but then I discovered this. I still think it needs a better DSL than this, but at least they provided a way to do this. Much needed.

      For this example, I might write something like this:

      step :decide_type, Output(Activity::Left, :credit_card) => Track(:with_credit_card)
      
      # Create the track, which would automatically create an implicit End with the same id.
      Track(:with_credit_card) do
          step :authorize
          step :charge
      end
      

      I guess that's not much different than theirs. Main improvement is it avoids ugly need to specify end_id/end_task.

      But that wouldn't actually be enough either in this example, because you would actually want to have a failure track there and a path doesn't have one ... so it sounds like Subprocess and a new self-contained ProcessCreditCard Railway would be the best solution for this particular example... Subprocess is the ultimate in flexibility and gives us all the flexibility we need)


      But what if you had a path that you needed to direct to from 2 different tasks' outputs?

      Example: I came up with this, but it takes a lot of effort to keep my custom path/track hidden/"isolated" and prevent other tasks from automatically/implicitly going into those steps:

      class Example::ValidationErrorTrack < Trailblazer::Activity::Railway
        step :validate_model, Output(:failure) => Track(:validation_error)
        step :save,           Output(:failure) => Track(:validation_error)
      
        # Can't use fail here or the magnetic_to won't work and  Track(:validation_error) won't work
        step :log_validation_error, magnetic_to: :validation_error,
          Output(:success) => End(:validation_error), 
          Output(:failure) => End(:validation_error) 
      end
      
      puts Trailblazer::Developer.render o
      Reloading...
      
      #<Start/:default>
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<End/:success>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Left} => #<End/:validation_error>
       {Trailblazer::Activity::Right} => #<End/:validation_error>
      #<End/:success>
      
      #<End/:validation_error>
      
      #<End/:failure>
      

      Now attempt to do it with Path... Does the Path() have an ID we can reference? Or maybe we just keep a reference to the object and use it directly in 2 different places?

      class Example::ValidationErrorTrack::VPathHelper1 < Trailblazer::Activity::Railway
         validation_error_path = Path(end_id: "End.validation_error", end_task: End(:validation_error)) do
          step :log_validation_error
        end
        step :validate_model, Output(:failure) => validation_error_path
        step :save,           Output(:failure) => validation_error_path
      end
      
      o=Example::ValidationErrorTrack::VPathHelper1; puts Trailblazer::Developer.render o
      Reloading...
      
      #<Start/:default>
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=validate_model>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<End/:validation_error>
      #<Trailblazer::Activity::TaskBuilder::Task user_proc=save>
       {Trailblazer::Activity::Left} => #<Trailblazer::Activity::TaskBuilder::Task user_proc=log_validation_error>
       {Trailblazer::Activity::Right} => #<End/:success>
      #<End/:success>
      
      #<End/:validation_error>
      
      #<End/:failure>
      

      It's just too bad that:

      • there's not a Railway helper in case you want multiple outputs, though we could probably create one pretty easily using Path as our template
      • we can't "inline" a separate Railway acitivity (Subprocess "nests" it rather than "inlines")
    1. Six lines of code create an executable object that, when invoked, will run your code in the order as visible in our diagram, plus the ability to “error out” when something goes wrong.
    1. If you have value objects or you would like to build one object from another, you can use the converter option. It is only called if the value provided is not an instance of the class or one of its subclasses.
    2. Lambda defaults are evaluated in the context of the interaction, so you can use the values of other inputs in them.
    3. hash :with_defaults, default: {} do boolean :likes_cookies, default: true end
    1. With Grid and generated content, we can add a line either side of our heading without adding any additional markup. The line will grow and shrink according to available space
    1. When you generate before- and after-content pseudo-elements, Grid treats them as actual elements and makes them grid items.
    2. The 1 / -1 means “go from the first grid line to the last grid line of the explicit grid”, regardless of how many grid lines there might be. It’s a handy pattern to use in any situation where you have a grid item meant to stretch from edge to edge of a grid.
  7. Jan 2021
    1. While custom iterators are a useful tool, their creation requires careful programming due to the need to explicitly maintain their internal state. Generator functions provide a powerful alternative: they allow you to define an iterative algorithm by writing a single function whose execution is not continuous. Generator functions are written using the function* syntax.
  8. atomiks.github.io atomiks.github.io
    1. Can I use the title attribute?Yes. The content prop can be a function that receives the reference element as an argument and returns a string or element.tippy('button', { content(reference) { const title = reference.getAttribute('title'); reference.removeAttribute('title'); return title; }, });The title attribute should be removed once you have its content so the browser's default tooltip isn't displayed along with the tippy.
    1. Headless: With React's DOM rendering for improved usage with CSS-in-JS and spring libraries. If you want greater control over your poppers to integrate fully with design systems, this is for you.
  9. Dec 2020
  10. Nov 2020
    1. Service Workers are very powerful. They allow offline functionality, push notifications, content caching, and more. They have a short lifetime, and the way they work is by waking up when they get an event (e.g., network requests, push notifications, connectivity changes) and then they start running only as long as the process needs it.
  11. Oct 2020
    1. (../)#.git(:h) # relative path to containing directory, eg. '../../..', '.' (../)#.git(:a) # absolute path to actual file, eg. '/home/you/src/prj1/.git' (../)#.git(:a:h) # absolute path to containing directory, eg. '/home/you/src/prj1'
    1. The needs: keyword enables executing jobs out-of-order, allowing you to implement a directed acyclic graph in your .gitlab-ci.yml. This lets you run some jobs without waiting for other ones, disregarding stage ordering so you can have multiple stages running concurrently.
  12. mdxjs.com mdxjs.com
    1. Powerful: MDX blends markdown and JSX syntax to fit perfectly in JSX-based projects.
    1. IMO svelte does have a responsibility to teach/demo the basics of "functional javascript" probably as a docs/tutorial/demos chapter on "the power of javascript expressions"
    1. If you return an object, then it is possible to resolve an import to a different id while excluding it from the bundle at the same time. This allows you to replace dependencies with external dependencies without the need for the user to mark them as "external" manually via the external option
    2. Defines a custom resolver.
  13. Sep 2020
    1. I think Svelte's approach where it replaces component instances with the component markup is vastly superior to Angular and the other frameworks. It gives the developer more control over what the DOM structure looks like at runtime—which means better performance and fewer CSS headaches, and also allows the developer to create very powerful recursive components.
    2. They don't need to add a prop for every action. The action itself can be passed in as a prop. <script> export let action; </script> <div use:action>whatever</div> The argument for the action can be another prop or can be part of the same prop.
    1. await schema.validateAt('foo[0].bar', rootValue); // => ValidationError: must be a string await schema.validateAt('foo[1].bar', rootValue); // => '1'
  14. May 2020
    1. All of the features of NLS were in support of Engelbart's goal of augmenting collective knowledge work and therefore focused on making the user more powerful, not simply on making the system easier to use.
    1. Conditional Per-Request Settings For additional flexibility, the directives provided by mod_setenvif allow environment variables to be set on a per-request basis, conditional on characteristics of particular requests. For example, a variable could be set only when a specific browser (User-Agent) is making a request, or only when a specific Referer [sic] header is found. Even more flexibility is available through the mod_rewrite's RewriteRule which uses the [E=...] option to set environment variables.
  15. Jan 2020
    1. However forget the "one-liner" idea once you start using sed's micro-commands. It is useful to lay it out like a structured program until you get the feel of it... It is surprisingly simple, and equally unusual. You could think of it as the "assembler language" of text editing.
  16. Mar 2019
  17. Jan 2019
    1. power

      This claim is articulated pretty strongly in Gorgias's Encomium of Helen. The piece is a kind of thought experiment where Gorgias attempts to defend Helen. He points out that language (or speech) is "a powerful lord, which by means of the finest and most invisible body effects the divinest works: it can stop fear and banish grief and create joy and nature pity" (sec. 8). Part of his defense, then, is that Helen almost didn't have a choice; the speech was too powerful, god-like even. I found a .pdf copy of it here: http://myweb.fsu.edu/jjm09f/RhetoricSpring2012/Gorgias%20Encomium%20of%20Helen.pdf

    1. power

      This claim is articulated pretty strongly in Gorgias's Encomium of Helen. The piece is a kind of thought experiment where Gorgias attempts to defend Helen. He points out that language (or speech) is "a powerful lord, which by means of the finest and most invisible body effects the divinest works: it can stop fear and banish grief and create joy and nature pity" (sec. 8). Part of his defense, then, is that Helen almost didn't have a choice; the speech was too powerful, god-like even. I found a .pdf copy of it here: http://myweb.fsu.edu/jjm09f/RhetoricSpring2012/Gorgias%20Encomium%20of%20Helen.pdf

  18. Jul 2017
  19. Mar 2017
    1. speech is prior to and somehow superior to writing

      No matter how well written a document is, one powerful speech can move thousands in a single day while a document can only reach a few at a time.

      Not to mention the amount of illiterate people that were around when rhetoric came about.

    1. i!.course to exercise power. T

      We all know they immense power that discourse can hold, regardless of where the original knowledge came from, the appropriate discourse can light a match that starts a fire.