- Mar 2021
-
trailblazer.to trailblazer.to
-
To implement such an activity, we only need to rewire the second step’s failure output to a new terminus.
-
Visualized, our new composed structure would look as follows.
-
Suppose that the validate task was getting quite complex and bloated. When writing “normal” Ruby, you’d break up one method into several. In Trailblazer, that’s when you introduce a new, smaller activity.
-
Hey, that’s is an imaginary complication of our example - please don’t do this with every condition you have in your app.
Tags
- coming up with hypothetical examples
- nice diagram
- see content below
- artificial example
- extremes
- composition
- example: not how you would actually do it (does something wrong/bad/nonideal illustrating but we should overlook it because that's not the one thing the example is trying to illustrate/show us)
- trailblazer-activity: wiring/outputs/tracks
- good illustration (visual)
- see content above
- trailblazer-activity
- good example
- splitting code/component/function into smaller pieces
Annotators
URL
-
-
daniellakens.blogspot.com daniellakens.blogspot.com
-
Lakens, D. (2020, November 29). The 20% Statistician: Why I care about replication studies. The 20% Statistician. https://daniellakens.blogspot.com/2020/11/why-i-care-about-replication-studies.html
-
- Feb 2021
-
trailblazer.to trailblazer.to
-
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 breaksmagnetic_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")
-
step :direct_debit
I don't think we would/should really want to make this the "success" (Right) path and :credit_card be the "failure" (Left) track.
Maybe it's okay to repurpose Left and Right for something other than failure/success ... but only if we can actually change the default semantic of those signals/outputs. Is that possible? Maybe there's a way to override or delete the default outputs?
-
step :policy, before: :create_model
-
the validate task gets removed, assuming the Admin won’t need a validation
-
step Subprocess(Memo::Validate), Output(:invalid_params) => Track(:failure)
-
This connects the failure output to the previous task, which might create an infinity loop and waste your computing time - it is solely here for demonstrational purposes.
-
step :charge_creditcard, Output(:failure) => End(:declined)
-
step :charge_creditcard, Output(:failure) => End(:success) end This reconnects both outputs to the same end, always ending in a - desirable, yet unrealistic - successful state.
-
step :find_provider, Output(UsePaypal, :paypal) => Track(:paypal)
Tags
- semantics
- feels wrong
- example: in order to keep example concise/focused, may not implement all best practices (illustrates one thing only)
- I have a question about this
- flexibility
- example: not how you would actually do it (does something wrong/bad/nonideal illustrating but we should overlook it because that's not the one thing the example is trying to illustrate/show us)
- concise
- helper functions
- funny
- powerful
- trailblazer-activity
- verbose / noisy / too much boilerplate
- good example
- tip
- useful
Annotators
URL
-
-
trailblazer.to trailblazer.to
-
Yes, we could and should use Reform or Dry-validation here.
-
While you could program this little piece of logic and flow yourself using a bunch of Ruby methods along with a considerable amount of ifs and elses, and maybe elsif, if you’re feeling fancy, a Trailblazer activity provides you a simple API for creating such flow without having to write and maintain any control code. It is an abstraction.
-
-
github.com github.com
-
So, what can we do to check for None in our programs? You can use builtin Optional type and write a lot of if some is not None: conditions. But, having null checks here and there makes your code unreadable.
-
-
sobolevn.me sobolevn.me
-
Let’s start with the same number dividing example, which returns 0 when the error happens. Maybe instead we can indicate that the result was not successful without any explicit numerical value?
-
-
www.morozov.is www.morozov.is
-
This is how the same example would look like using raw monads:
-
-
trailblazer.to trailblazer.to
-
The legendary cfp-app will become a Rails-to-TRB refactoring tutorial.
-
-
unix.stackexchange.com unix.stackexchange.com
-
Example (in bash, but my question shouldn't be considered bash-specific):
-
-
stackoverflow.com stackoverflow.com
-
time run_with_timeout 3 sleep_and_exit 1 7; echo $?
-
-
stackoverflow.com stackoverflow.com
-
timeout_child () { trap -- "" SIGTERM; child=$!; timeout=$1; ( sleep $timeout; kill $child; ) & wait $child; } And the usage: ( while true; do echo -n .; sleep 0.1; done) & timeout_child 2
-
-
-
{a: 1, b: 2, c: 3, d: 4} => {a:, b:, **rest} # a == 1, b == 2, rest == {:c=>3, :d=>4}
equivalent in javascript:
{a, b, ...rest} = {a: 1, b: 2, c: 3, d: 4}
Not a bad replacement for that! I still find javascript's syntax a little more easily readable and natural, but given that we can't use the same syntax (probably because it would be incompatible with existing syntax rules that we can't break for compatibility reasons, unfortunately), this is a pretty good compromise/solution that they've come up with.
-
-
github.com github.com
-
def edit account = find_account! @account = UpdateAccount.new( account: account, first_name: account.first_name, last_name: account.last_name) end
-
> RecordInteraction.run!(encoding: 'ascii') => #<Encoding:US-ASCII>
Makes use of the fact that you can do:
main > Encoding.find('ascii') => #<Encoding:US-ASCII>
and that
If the value does not match, it will call
find
on the class of the record.
-
-
github.com github.com
-
array :translations do hash do string :locale string :name end end array inputs can only have one input nested underneath them. This is because every element of the array must be the same type. And the inputs nested inside arrays cannot have names because they would never be used.
-
-
github.com github.com
-
describe '.validate(context, filters, inputs)' do let(:inputs) { {} } let(:filter) { ActiveInteraction::Filter.new(:name, {}) } let(:interaction) do
-
-
en.wikipedia.org en.wikipedia.org
-
In a rule-based system, a metarule is a rule governing the application of other rules.
Tags
Annotators
URL
-
-
www.merriam-webster.com www.merriam-webster.com
-
The word home, for instance, has a denotation of “the place (such as a house or apartment) where a person lives,” but it may additionally have many connotations (such as “warmth,” “security,” or “childhood”) for some people.
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
Depending on the politics it might either mean that the implementation can no longer be changed, because that would break your code, or that your code is very fragile and keeps breaking on every upgrade or change of the underlying implementation.
not quite sure how this is politics, but interesting example
-
Say you have software to keep track of your grocery list. In the 80's, this software would work against a command line and some flat files on floppy disk. Then you got a UI. Then you maybe put the list in the database. Later on it maybe moved to the cloud or mobile phones or facebook integration. If you designed your code specifically around the implementation (floppy disks and command lines) you would be ill-prepared for changes. If you designed your code around the interface (manipulating a grocery list) then the implementation is free to change.
-
It's more like providing an Employee object rather than the set of linked tables you use to store an Employee record. Or providing an interface to iterate through songs, and not caring if those songs are shuffled, or on a CD, or streaming from the internet. They're just a sequence of songs.
-
-
github.com github.com
-
class ConferencesController def create conference = Conference.new @conference_form = ConferenceForm.new(conference) @conference_form.submit(conference_params) if @conference_form.save redirect_to @conference_form, notice: "Conference: #{@conference_form.name} was successfully created." } else render :new end end end
-
You can find a list of applications using this gem in this repository: https://github.com/m-Peter/nested-form-examples . All the examples are implemented in before/after pairs. The before is using the accepts_nested_attributes_for, while the after uses this gem to achieve the same functionality.
Tags
Annotators
URL
-
-
github.com github.com
-
class UsersController < ApplicationController def create success = -> (response, time) { redirect_to root_path, notice: "#{response} - at: #{time}" } failure = -> { render :new } Workflow::CreateUser.call(params[:name], success: success, failure: failure) end end
Tags
Annotators
URL
-
-
criticmarkup.com criticmarkup.com
-
Don't go around saying{-- to people that--} the world owes you a living. The world owes you nothing. It was here first. {~~One~>Only one~~} thing is impossible for God: To find {++any++} sense in any copyright law on the planet. {==Truth is stranger than fiction==}{>>strange but true<<}, but it is because Fiction is obliged to stick to possibilities; Truth isn’t.
.example
-
-
educationinnovation.pressbooks.com educationinnovation.pressbooks.com
-
Are designers also wasting the time of the critics?
Wow what a way to end the chapter. Are instcutional Designers wasting their time decorating their instruction or filling them with jargon that they miss the point of educating the learners.
This is a wonderful story about something that anyone could be familiar with and understand how instrucitonal design can go at times. Lending to the attractiveness and lacking on the informing side.
-
-
css-tricks.com css-tricks.com
-
The syntax itself provides a visualization of the structure of the grid.
What is this an example of? self-referencing? self-presentation? duality?
-
-
alistapart.com alistapart.com
-
The first problem is that if you ever remove an item, there will be a big black block in the layout. Maybe that’s OK, but more likely it isn’t. The second problem is that grid containers do not, by default, shrink-wrap their items. Instead, they fill out the parent element, as block boxes do. Both of these problems are illustrated in Figure 6.
-
div:nth-of-type(3n+1) { grid-column: 1; } div:nth-of-type(3n+2) { grid-column: 2; } div:nth-of-type(3n+3) { grid-column: 3; } div:nth-of-type(-n+3) { grid-row: 1; }
-
#ttt > * { border: 1px solid black; border-width: 0 1px 1px 0; display: flex; /* flex styling to center content in divs */ align-items: center; justify-content: center; } #ttt > *:nth-of-type(3n) { border-right-width: 0; } #ttt > *:nth-of-type(n+7) { border-bottom-width: 0; }
-
-
codepen.io codepen.io
-
css-tricks.com css-tricks.com
-
Your grid areas can only be rectangles (like the left), not arbitrary polygons (like the right).
-
-
developer.mozilla.org developer.mozilla.org
-
.box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; } .box2 { grid-column-start: 1; grid-row-start: 2; grid-row-end: 4; }
-
- Jan 2021
-
api.rubyonrails.org api.rubyonrails.org
-
config.action_mailer.register_preview_interceptor :css_inline_styler
That's probably the same hook that https://github.com/fphilipe/premailer-rails ties into, for it says:
Emails are only processed upon delivery, i.e. when calling
#deliver
on the email, or when previewing them in rails.
-
-
github.com github.com
-
Previewing You can create a controller that gets the email and then renders the body from it.
mailer preview
-
-
github.com github.com
-
The following Sankey flow diagram shows the current glyph sets included:
-
-
css-tricks.com css-tricks.com
-
-
Try out the different border-image-repeat values in this demo
-
-
developer.mozilla.org developer.mozilla.org
-
The background-origin CSS property sets the background's origin: from the border start, inside the border, or inside the padding.
-
-
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
github.com github.com
-
I want to make some add-ons or wrappers on components e.g BigButton.svelte <script> import Button from './Button.svelte' </script> <Button fz="16" h="64" {...$$props}> <slot slot="prepend" name="prepend" /> <slot /> <slot slot="append" name="append" /> </Button>
-
-
svelte.dev svelte.dev
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
github.com github.com
-
Also as an aside, your REPL is far, far too complicated. You've got a much better chance of us being able to see your issue and fix it if you boil it down to just the minimum required code in order to reproduce the issue.
-
-
svelte.dev svelte.dev
-
beforeUpdate(async () => { console.log('the component is about to update'); await tick(); console.log('the component just updated'); });
-
-
atomiks.github.io atomiks.github.io
-
You may want the tippy to appear at a different location from its trigger (event listeners) target. For example:
-
Context menu
-
-
developer.mozilla.org developer.mozilla.orgz-index1
-
stackoverflow.com stackoverflow.com
-
{#each charts as chart, i} <div class="wrapper"> <div class="icon" on:click={e => instances[i].handle(e)}>Click</div> <div class="content"> <svelte:component this={charts[i]} bind:this={instances[i]} /> </div> </div> {/each} ...where each child component exports a handle method: <script> let event; export function handle(e){ event = e; }; </script>
-
- Dec 2020
-
medium.com medium.com
-
What is a data-originated component? It’s a kind of component that is primarily designed and built for either: displaying, entering, or customizing a given data content itself, rather than focusing on the form it takes. For example Drawer is a non data-originated component, although it may include some. Whereas Table, or Form, or even Feed are good examples of data-originated components.
-
-
sveltematerialui.com sveltematerialui.com
Tags
Annotators
URL
-
-
www.iditect.com www.iditect.com
-
const store = observable({ players: [ "Player 1", "Player 2", ], // ... }) reaction(() => JSON.stringify(store), json => { localStorage.setItem('store',json); }, { delay: 500, }); let json = localStorage.getItem('store'); if(json) { Object.assign(store, JSON.parse(json)); }
-
-
github.com github.com
Tags
Annotators
URL
-
-
github.com github.com
- Nov 2020
-
medium.com medium.com
-
But, it’s not how we usually work with Svelte and write reusable components such asUnorderedListor similar. Because your example is really synthetic and unuseful in the real world.
-
-
cryptocurrencyresearch.org cryptocurrencyresearch.org
-
highlighting
Example of an annotation. Feel free to leave your own comments!
-
-
developer.mozilla.org developer.mozilla.org
-
The use of __proto__ is controversial and discouraged. It was never originally included in the ECMAScript language spec, but modern browsers implemented it anyway. Only recently was the __proto__ property standardized by the ECMAScript 2015 specification for compatibility with web browsers, so it will be supported into the future.
-
-
material.io material.ioRally1
-
material.io material.ioReply1
-
cs3mesh4eosc.eu cs3mesh4eosc.eu
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
If you were to check the return status of every single command, your script would look like this:
Illustrates how much boilerplate set -e saves you from.
Update: Oops, if you read a comment further below, you learn that:
Actually the idiomatic code without
set -e
would be justmake || exit $?
True that.
-
-
mywiki.wooledge.org mywiki.wooledge.org
-
true && { echo true; false; } || { echo false; true; }
-
true && ((i++)) || ((i--))
-
-
github.com github.com
-
docker build --cache-from=base_image:2.2.1,custom-gource:0.1 . -t custom-gource:0.2
Tags
Annotators
URL
-
-
-
this is the problem with that method.
-
-
madewithsvelte.com madewithsvelte.com
-
Why do we need this proprietary service?
So they can track us when we go to: http://svelte-autocomplete.surge.sh/?ref=madewithsvelte.com ?
Rather than bookmark/use https://madewithsvelte.com/svelte-autocomplete I would prefer to just use https://github.com/elcobvg/svelte-autocomplete as the canonical URL for this project.
-
- Oct 2020
-
www.scispike.com www.scispike.com
-
I came up with this solution by piecing together man pages and random google result. I was surprised at how many incomplete and inaccurate answers were out there. What may have been more surprising was the complete lack of a full intact solution.
-
-
www.techopedia.com www.techopedia.com
-
A spreadsheet may be represented as a directed acyclic graph, with each cell a vertex and an edge connected a cell when a formula references another cell. Other applications include scheduling, circuit design and Bayesian networks.
-
-
www.jstor.org www.jstor.org
-
rms of Global Systems, but we do need an earth- wide network of connections, including the ability partially to translate knowledges among very different-and power-differenti- ated - communities. We need the power of modern critical theories of how meanings and bodies get made, not in order to deny meanings and bodies, but in order to build meanings and bodies that have a chance for life.
Arguing against Marxist feminists. And for the preservation of theories and an appreciation of people's actual experiences in order to make meaning of things and give non-white bodies a chance of life. (Beyond the white male understanding.... )
-
any ca
Social constructionism is a theory of knowledge in sociology and communication theory that examines the development of jointly-constructed understandings of the world that form the basis for shared assumptions about reality. https://www.google.com/search?client=firefox-b-d&q=social+constructionists
-
e the law of the fath
"The “law of the father” is a term usually associated with the work of Jacques Lacan in his psychoanalytic account of the way in which children enter into patriarchal culture. Lacan identified three phases of psychosocial development involved in this process: the “imaginary order,” the “mirror stage,” and the “symbolic order.” Lacan's work has been contested to the extent that it has been interpreted as a justification for patriarchal social relationships, as well as being developed and utilized by feminists, particularly French feminists. Marxist feminists have also utilized the work of Lacan." https://onlinelibrary.wiley.com/doi/abs/10.1002/9781118663219.wbegss446
Tags
Annotators
URL
-
-
docs.gitlab.com docs.gitlab.com
-
Here is a simplified example of a malicious .gitlab-ci.yml
-
-
www.basefactor.com www.basefactor.com
-
const countriesRegExp = countries.reduce( (regex, country, i) => (i === 0 ? `(${country})` : `${regex}|(${country})`), "" )
-
-
xtzmf.csb.app xtzmf.csb.app
-
github.com github.com
-
Local file Local file
-
neoliberalism, can be seen not only as destructive of trad-itional versions of Professionalism, but as Foucault argued, is also product-ive of new practices shaped by the market.
-
‘old professionalism’included therelative autonomy of the profession to control the‘field of judgement’(Ball, 2003, p. 216) and determine its own professional remit (seeTett, 2010;Ledwith, 2011). In contrast, the main features of this new version of profes-sionalism are centred on the ways in which the profession has been trans-formed into an instrument of economic policy and, in particular, thechanges in competencies which have accompanied this development.
Now the professional is an instrument of economic policy
-
‘organisational’professional-ism (seeEvetts, 2009) - that is—a profession whose remit is controlled byemployers—in this instance the local state.Evetts (2009)argues that‘organisational professionalism’has displaced an older model of profes-sionalism -‘occupational’professionalism, whereby professions were sub-ject to internal regulation and control by ethical standards that wereoccupationally defined
shift from standards of ethics and regulations in control to the employer standard of new profesionalism - data- and evidence-driven decisionmaking.
-
managers and practitioners regularly discuss their‘work’in terms of‘measuring outcomes’,‘improving outputs’,‘promotingbest practice’,‘promoting sector leading practices’,‘benchmarking’,‘qual-ity assurance’,‘better outputs’,‘continual improvement’and being‘BOLD’(better outcomes leaner delivery).
-
performance targets’of practitioners, for example, I noted that many targets are related to themanagement of austerity in one way or another. Typical‘performance tar-gets’include such objectives as‘increase the number of DevelopmentTrusts and Social Enterprises providing services’,‘increase the number ofasset transfers’;‘increase the number of volunteers engaged in servicedesign and delivery’
performance targets - illustrated to support his argument and framework.
-
Foucault’s proposition that neoliberalism‘penetrates more deeply intopeople’s psyches’
this is a description of how neoliberalism has reconceived power.
-
neoliberalism is productive of a new form of profes-sionalism is theoretically indebted to Foucaul
-
-
github.com github.com
-
medium.com medium.com
-
Examples of this include: requiring base classes or reading from imported variables that have not been initialized yet.
-
we will work with an artificial application that pretty prints object trees into a YAML like format
-
-
medium.com medium.com
-
These are fine and do not cause any issues.
-
-
stackoverflow.com stackoverflow.com
-
Omitted details change everything here. There won't be circular dependency because unused import is skipped. Consider providing stackoverflow.com/help/mcve .
-
-
-
Informative data about objects that are considered prototypes for the role. Base concept is similar to type, but without inheritance of limitations and properties. Base concepts are designed as a substitute for inheritance for external concepts. A base concept is like a related concept except that the base concept is almost identical to the role definition.
-
-
svelte.dev svelte.dev
-
Where was this referenced from? Some svelte/issues/__, I assume....
-
-
final-form.org final-form.org
-
Returns a Promise<?Object> that resolves with no value on success or resolves with an Object of submission errors on failure. The reason it resolves with errors is to leave rejection for when there is a server or communications error.
-
-
final-form.org final-form.org
-
Listening for External Changes By wrapping a stateful ExternalModificationDetector component in a Field component, we can listen for changes to a field's value, and by knowing whether or not the field is active, deduce when a field's value changes due to external influences.
-
-
codesandbox.io codesandbox.io
-
-
codesandbox.io codesandbox.io
-
// Make a HOC // This is not the only way to accomplish auto-save, but it does let us: // - Use built-in React lifecycle methods to listen for changes // - Maintain state of when we are submitting // - Render a message when submitting // - Pass in debounce and save props nicely export default props => ( <FormSpy {...props} subscription={{ values: true }} component={AutoSave} /> );
-
-
-
svelte.dev svelte.dev
-
Not all application state belongs inside your application's component hierarchy. Sometimes, you'll have values that need to be accessed by multiple unrelated components, or by a regular JavaScript module.
-
-
github.com github.com
-
const { getByRole } = render(<input bind_value={text}>)
Directly compare to: https://hyp.is/T2NGMA5ZEeu2k6dW8hBd9g/github.com/kenoxa/svelte-htm
-
-
github.com github.com
-
const { getByRole } = render(html`<input bind:value=${text} />`)
Directly compare to: https://hyp.is/KXd5yA5ZEeu9_K_HXsDR2w/github.com/kenoxa/svelte-jsx
-
render(html`<${Button} on:click=${() => (clicked += 1)}>Click Me!<//>`)
Compared to https://github.com/kenoxa/svelte-jsx#api, this alows on:click instead of on_click.
So maybe this syntax allows for fewer workarounds overall?
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
Right, and if most uses of an FTP service use new FtpService() the one that sets an alternate port will stand out (service.SetPort(12345))
-
-
-
by using tagged templates we can inline function calls
(below)
-
-
stackoverflow.com stackoverflow.com
-
Encoding examples:
-
-
-
This would be like an executable proposal. I understand that it's beyond the original intent of having canonical patterns on the Svelte site, but it would facilitate the community to express their own patterns. Now that we have markdown preprocessors , the documentation itself can be an app.
-
More in-depth examples definitely sound like a good idea. I've seen cookbooks quite a few times already and they are always helpful.
-
-
-
This seems crucial, for example for #if inside #each {#each boxes as box} {@const b = box?.a?.b} {#if b} <p>{b}</p> {/if} {/each}
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
svelte.dev svelte.dev
-
raw.githubusercontent.com raw.githubusercontent.com
-
<Playground> ```html filename=index.html
-
-
codesandbox.io codesandbox.io
-
svelte.dev svelte.dev
-
reactjs.org reactjs.org
-
Data fetching, setting up a subscription, and manually changing the DOM in React components are all examples of side effects.
-
-
twitter.com twitter.com
-
Adam Kucharski on Twitter. (n.d.). Twitter. Retrieved October 10, 2020, from https://twitter.com/AdamJKucharski/status/1313760847932596224
-
-
Local file Local file
-
An example for a dialectical alternative media strategy is the Canadian Adbusters magazine. It is financed by donationsand sales and has a paid circulation of about 120.000.
The authors cite the Canadian Adbusters magazine as an example of an alternative media that is radical while remaining separate for commoditization of its readership to capitalistic ends. And also Mother Jones. THey both reach broad audiences.
-
Indymedia. Indymedia uses a ‘‘democratic open-publishing system”,is‘‘collectively run”, and ‘‘a decentralized and autonomousnetwork”(Indymedia, 2009).
giving an example of alternative type of media and characterizing it.
-
-
-
One with a Gun, One with a Dog, and One with the Shivers
Example Impressionist ethnography
-
One with a Gun, One with a Dog, and One with the Shivers
Example Impressionist ethnography
-
Hats-on Harry, Off-at-Seven George, Handle-It-Yourself Fred, and The-Eternal-Flame Edward Who-Never-Goes-Out
Example Realist Ethnography
-
Johnny Gets His Gun
Example comfessional ethnography
-
Johnny Gets His Gun
Example comfessional ethnography
-
-
codesandbox.io codesandbox.io
-
Is that expected behavior or am I doing something wrong?
-
-
codesandbox.io codesandbox.io
-
even simpler example than the https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/simple?from-embed=&file=/index.js it was based on
-
-
svelte.dev svelte.dev
-
archive.org archive.org
-
all reacting in the same way to the like need of protection from the rain-
Social action that is related to an event, but not related to collective benefit.
Narrows here the idea of social action.
Tags
Annotators
URL
-
-
-
Proposed workarounds get particularly awkward for multiple stores
good example follows
-
-
svelte.dev svelte.dev
-
github.com github.com
-
Made the repro above more manageable: https://svelte.dev/repl/a55ba18ceca44c898f2b011a0978de85?version=3.6.6
-
- Sep 2020
-
svelte.dev svelte.dev
-
Bug repro for https://github.com/sveltejs/svelte/issues/2086
Fixed by: Bug 1:
- https://github.com/sveltejs/svelte/pull/3172
- https://github.com/sveltejs/svelte/pull/3172/commits/f4ca063c85e491b75d162f429ad243b6f443db13
Bug 2:
- https://github.com/sveltejs/svelte/pull/3209
- https://github.com/sveltejs/svelte/commit/2f08e34b41317619f9bc7bf6bc2418123fb06829
Fixed version here: https://svelte.dev/repl/a55ba18ceca44c898f2b011a0978de85?version=3.6.7
(although https://github.com/sveltejs/svelte/pull/3172/commits/f4ca063c85e491b75d162f429ad243b6f443db13 indicates the fix was included in v3.6.6 tag, so I wonder why it's not fixed here)
supersedes https://codesandbox.io/s/epic-stonebraker-9cxhu?file=/index.js:0-32
Good example of how helpful it is to remove everything irrelevant and create minimal reproducible example.
-
-
-
blog.carbonfive.com blog.carbonfive.com
-
This is pretty good, but I don’t love that $contactStore.length bit. If we wanted to change the shape of the store from an array to a key-value store or something, we’d have to remember to update this component too. Instead, we can define a new derived store: contactCountStore. It’ll always track the count, which lets this component have less knowledge about the structure of the store. That refactor looks like this:
-
-
svelte.dev svelte.dev
-
rollupjs.org rollupjs.orgRollup1
-
The difference between default and named affects how other people can consume your bundle. If you use default, a CommonJS user could do this, for example:
include the following content
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
-
I have created an action for form validation and its really working well
-
-
-
This is a little confusing to describe. An example:
-
-
medium.com medium.com
-
codesandbox.io codesandbox.io
-
Proving to myself that isValid does correctly change to true even when a key in $errors is an array.
-
-
svelte-forms-lib-sapper-docs.now.sh svelte-forms-lib-sapper-docs.now.sh
-
svelte.dev svelte.dev
-
Child can't update things by reassignment if you do:
<Child bind:things={things} />
but can if you do;
<Child bind:things={$object.things} />
-
-
svelte.dev svelte.dev
-
<Child bind:things={$object.things} />
-
-
svelte.dev svelte.dev
-
Demonstrates that even though
object.value
kind of works, it will be out of date. You need to subscribe to it to get current value:$object.value
-
-
-
"The First Amendment and Supreme Court decisions protect the news media in their reporting on matters of public interest, so you really have to show actual malice and disregard for the truth that would be very blatant and very provable," said Gene Policinski, senior vice president of the First Amendment Center.
Our mission: providing resources to help the public understand how their First Amendment freedoms of speech, press, religion, assembly and petition work, and how they can be protected.
FIRST AMENDMENT EXPERTS The First Amendment Center’s nationally recognized experts David Hudson, Lata Nott, and Gene Policinski regularly provide the media with information and commentary on First Amendment and free expression issues. Interested in contacting one of our experts? Please email media@newseum.org or call 202/292-6200.
-
-
svelte.dev svelte.dev
-
svelte.dev svelte.dev
-
developer.mozilla.org developer.mozilla.org
-
async function onEdit() { editing = true // enter editing mode await tick() nameEl.focus() }
-
-
codesandbox.io codesandbox.io
Tags
Annotators
URL
-
-
www.mercadopago.com.ar www.mercadopago.com.ar
-
Argentina Argentina Brazil Peru Colombia Uruguay Chile Mexico EN
-
-
github.com github.com
-
For example, you might want to use the browser’s knowledge of the user’s current time zone to group a collection of elements by date.
Tags
Annotators
URL
-
-
github.com github.com
-
If you can't understand where it's coming from in the stack traces, please post screenshots or create reproducing sandboxes and we'll try to help. Most of these are probably coming from a few libraries, so the most productive thing to do is to reduce these cases and then file issues with those libraries.
-
- Aug 2020
-
bookdown.org bookdown.org
-
select some text
this is an example of annotation.
If you wish, you can add images, videos, or links.
To add tags, type in the bow below and press Enter.
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
Tags
Annotators
URL
-
-
codesandbox.io codesandbox.io
-
This illustrates the difference between two types of scrolling:
- scrolling within the dialog
- scrolling the document that includes the dialog
Tags
Annotators
URL
-
-
www.meetup.com www.meetup.com
-
Corporate social media has been dominating the online space so significantly that the newest generation of Internet users now thinks that is what the "web" actually is. Fortunately, with WordPress as your platform, you can not only take back your online identity and presence, but you can use it to have a richer and fuller experience than the locked-down experience you get with the limits of Facebook, Twitter, Instagram, etc.
make a note
-
-
meta.stackexchange.com meta.stackexchange.com
-
But it's easy to imagine that the caption was incorrect for too long because those who know the language, know where the mistake is, and those who don't, think that it's the correct way to spell it.
those who know the language, know where the mistake is, In other words, they can easily spot the mistake and no better than to repeat it themselves, but either are powerless or too lazy to actually fix it on SE.
and those who don't, think that it's the correct way to spell it. So those who should no better are inadvertently perpetuating the mistake and teaching others that it is an acceptable/correct usage.
-
Can't upvote this enough. It is highly irritating to see language destroyed (and we wonder why kids bastardize the language..).
Tags
- popular misconceptions
- combating widespread incorrectness/misconception by consistently doing it correctly
- perpetuation
- even if majority makes a mistake; it doesn't make it correct
- lead by example
- example of: using incorrect terms
- be a good example for others
- correctness
- hoping/trying to convince others that your view/opinion/way is right by consistently sticking to it despite many being ignorant/mistaken/unaware/holding different opinion
Annotators
URL
-
-
en.wiktionary.org en.wiktionary.org
-
proscriptive, nonprescriptive
Interesting how a word can have multiple antonyms/opposites that are "opposite" in different ways/senses:
- proscriptive: forbid rather than prescribe
- nonprescriptive: absence of prescribing
Tags
Annotators
URL
-
-
english.stackexchange.com english.stackexchange.com
-
Perhaps someone should give an example of when 'into' is ever correct. "Turn into bed" is definitely incorrect, unless one is morphing into the form of a bed. But what about "he fell into the hole", "she went into the house", or "Star Trek Into Darkness"?
-
-
en.wikipedia.org en.wikipedia.org
-
For example, the word dog describes both the species Canis familiaris and male individuals of Canis familiaris, so it is possible to say "That dog isn't a dog, it's a bitch" ("That hypernym Z isn't a hyponym Z, it's a hyponym Y").
-
- Jul 2020
-
edpb.europa.eu edpb.europa.eu
-
When downloading a lifestyle mobile app, the app asks for consent to access the phone’saccelerometer. This is not necessary for the app to work, but it is useful for the controller who wishesto learn more about the movements and activity levels of its users. When the user later revokes thatconsent, she finds out that the app now only works to a limited extent. This is an example of detrimentas meant in Recital 42, which means that consent was never validly obtained (and thus, the controllerneeds to delete all personal data about users’ movements collected this way).
-
-
www.smashingmagazine.com www.smashingmagazine.com
-
make users the initiators of actions rather than the responders.
This is a pretty good definition (?, or at least example) of what agency is.
-
- Jun 2020
-
en.wikipedia.org en.wikipedia.org
-
For example, if error messages in two narrowly defined classes behave in the same way, the classes can be easily combined. But if some messages in a broad class behave differently, every object in the class must be examined before the class can be split. This illustrates the principle that "splits can be lumped more easily than lumps can be split".
-
-
medium.com medium.com
-
An example candidate for caching might be a nightly billing task which aggregates billing data for the past month. That kind of task is likely not expecting last minute updates while it runs. It assumes that the state of the world remains constant while processing.
-
-
www.reddit.com www.reddit.com
-
<script> let a = 1; let b = 2; </script> <input type="number" bind:value={a}> <input type="number" bind:value={b}> <p>{a} + {b} = {a + b}</p>
-
-
15721.courses.cs.cmu.edu 15721.courses.cs.cmu.edu
-
including Oracle (since 1984 [4]), Postgres(since 1985 [41]), and MySQL’s InnoDB engine (since 2001). Butwhile there are plenty of contemporaries to these older systemsthat use a single-version scheme (e.g., IBM DB2, Sybase), almostevery new transactional DBMS eschews this approach in favor ofMVCC [37]. This includes both commercial (e.g., Microsoft Heka-ton [16], SAP HANA [40], MemSQL [1], NuoDB [3]) and academic(e.g., HYRISE [21], HyPer [36]) systems
-
-
www.thelancet.com www.thelancet.com
-
The Lancet. (2020). Sustaining containment of COVID-19 in China. The Lancet, 395(10232), 1230. https://doi.org/10.1016/S0140-6736(20)30864-3
-
- May 2020
-
docs.gitlab.com docs.gitlab.com
-
In this example
Tags
Annotators
URL
-
-
ubuntu.com ubuntu.com
-
Ubuntu 20.04 LTS
-
-
gitlab.com gitlab.com
-
www.merriam-webster.com www.merriam-webster.com
-
of, relating to, or being a grammatical case or form expressing means or agency
I really need an example of this!
It seems unusual that they specifically mention "a grammatical case or form". I've never seen a definition before that is anything like this one.
How is this different from definition 1?
-
-
www.merriam-webster.com www.merriam-webster.com
-
communicated through the agency of the ambassador
-
-
ico.org.uk ico.org.ukHome1
-
gitlab.com gitlab.com
-
Sometimes it's useful to refine the type of an issue. In those cases, you can add facet labels.
-
-
www.w3.org www.w3.org
-
sadness.js will not load, however, as document.write() produces script elements which are "parser-inserted".
Tags
Annotators
URL
-