profile
viewpoint
Henrik Nyh henrik @barsoom Todmorden, UK https://henrik.nyh.se Swedish web developer and pug automator in West Yorkshire, UK.

henrik/augmentations 64

Rails plugin that provides a simple API for extending a model/class from a module.

henrik/bookmarks_bar_keyboard_shortcuts 12

Chrome/Chromium extension. Trigger the first ten Bookmarks Bar items with Ctrl+1 through Ctrl+0.

henrik/blocket_se_feeds 11

Ruby CGI script to provide Atom feeds of Blocket.se searches.

henrik/action_mailer_tls 5

Use Gmail SMTP server to send emails in Rails ActionMailer

henrik/atomica 5

Ruby CGI script to provide an Atom feed of your ICA-banken account activity.

henrik/autho 5

A many-stop shop for authentication.

aalin/processingspec 4

Ruby-Processing spec formatter

henrik/albino 3

Ruby wrapper for the Pygments syntax highlighter.

henrik/ack.vim 2

Vim plugin for the Perl module / CLI script 'ack'

henrik/adventofcode2015 2

http://adventofcode.com/ solutions. All 25 days. Mix of Ruby and Elixir. Not refactored…

started93s/phx-hook

started time in 18 hours

push eventhenrik/etsy-rss

Henrik Nyh

commit sha f89ad75294c74d1be041c03921b8e91a4e6467b4

README: Not maintained

view details

push time in 5 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 7708a8afe9e27e428abfdb72f1fdc5832870d165

Unbreak deploy (eex not a supported format) > "eex" is not a valid Prism.js language for eleventy-plugin-syntaxhighlight

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 083fd1ecba5784cf350ce1c0a2ce5167808674c4

Mention that process registry is node-local You can register processes globally (via :global or other libs), but I suspect you might as well use PubSub then.

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 07b296dd1daa21dd6098f2407bbd920798a9b3a1

Correctify EEx example

view details

Henrik Nyh

commit sha 3a314c07de770b2e47824db5ce42152f8660e8dd

Tweak

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 8e641bf12dd283f3f3a65af3fa4d141bf2278cec

Tweak Not just any ancestor.

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 0f174568440039aae31374fab2d238b75ba006be

Link to post-specific tweet for feedback

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha d9bdd959644f3354105cafdec1b3233a123676e6

Language 'suitable for' or 'suited to', I think.

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 24b761746182b11eac622c341f126822ea24770b

Clarify

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 46d7e64a086372aae3a555d0c0ea195256a8bef0

Clarify

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 36277bc362387f80a445bbe3e0d9e647cad8600d

Clarify

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha d7770de99e37bbbfdd634016dde5dee39d91935d

Clarify

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 985ab573a584ea4e5b3ac4b439bcf62a231025df

Mention PubSub using more resources than send I don't have any numbers, but this seems very likely.

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha f2cd19e41b25a30151e373141b9d8799b9098cfe

Clarify what triggers handle_event

view details

push time in 10 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 99033189508c21f76ba88dbad1ce64936557e7f4

New post: Communicating between LiveViews on the same page

view details

push time in 10 days

push eventhenrik/broadway

Henrik Nyh

commit sha 872eedf54b2316a21b13ad54bf55eb949cc3a443

README: Grammar

view details

push time in 15 days

PR opened dashbitco/broadway

README: Grammar
+1 -1

0 comment

1 changed file

pr created time in 15 days

fork henrik/broadway

Concurrent and multi-stage data ingestion and data processing with Elixir

fork in 15 days

push eventbarsoom/ex-remit

Henrik Nyh

commit sha fec780280753454ab397f577428cb01d26fae7ae

Whitespace

view details

push time in 16 days

issue commentbarsoom/ex-remit

Show counts on the comment filter links?

Will close this for now – haven't missed it.

henrik

comment created time in 16 days

push eventbarsoom/ex-remit

dependabot[bot]

commit sha 264edb1ac86ef2f3bbad97af016305d316dd889a

Bump lodash from 4.17.15 to 4.17.19 in /assets Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com>

view details

Henrik Nyh

commit sha 90f5d64d140cc7f6787d8c49c60fc931c0c64848

Merge pull request #39 from barsoom/dependabot/npm_and_yarn/assets/lodash-4.17.19 Bump lodash from 4.17.15 to 4.17.19 in /assets

view details

push time in 16 days

PR merged barsoom/ex-remit

Bump lodash from 4.17.15 to 4.17.19 in /assets dependencies

Bumps lodash from 4.17.15 to 4.17.19. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/lodash/lodash/releases">lodash's releases</a>.</em></p> <blockquote> <h2>4.17.16</h2> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/lodash/lodash/commit/d7fbc52ee0466a6d248f047b5d5c3e6d1e099056"><code>d7fbc52</code></a> Bump to v4.17.19</li> <li><a href="https://github.com/lodash/lodash/commit/2e1c0f22f425e9c013815b2cd7c2ebd51f49a8d6"><code>2e1c0f2</code></a> Add npm-package</li> <li><a href="https://github.com/lodash/lodash/commit/1b6c282299f4e0271f932b466c67f0f822aa308e"><code>1b6c282</code></a> Bump to v4.17.18</li> <li><a href="https://github.com/lodash/lodash/commit/a370ac81408de2da77a82b3c4b61a01a3b9c2fac"><code>a370ac8</code></a> Bump to v4.17.17</li> <li><a href="https://github.com/lodash/lodash/commit/1144918f3578a84fcc4986da9b806e63a6175cbb"><code>1144918</code></a> Rebuild lodash and docs</li> <li><a href="https://github.com/lodash/lodash/commit/3a3b0fd339c2109563f7e8167dc95265ed82ef3e"><code>3a3b0fd</code></a> Bump to v4.17.16</li> <li><a href="https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12"><code>c84fe82</code></a> fix(zipObjectDeep): prototype pollution (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4759">#4759</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/e7b28ea6cb17b4ca021e7c9d66218c8c89782f32"><code>e7b28ea</code></a> Sanitize sourceURL so it cannot affect evaled code (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4518">#4518</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/0cec225778d4ac26c2bac95031ecc92a94f08bbb"><code>0cec225</code></a> Fix lodash.isEqual for circular references (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4320">#4320</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4515">#4515</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/94c3a8133cb4fcdb50db72b4fd14dd884b195cd5"><code>94c3a81</code></a> Document matches* shorthands for over* methods (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4510">#4510</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4514">#4514</a>)</li> <li>Additional commits viewable in <a href="https://github.com/lodash/lodash/compare/4.17.15...4.17.19">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~mathias">mathias</a>, a new releaser for lodash since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+3 -9

0 comment

1 changed file

dependabot[bot]

pr closed time in 16 days

push eventbarsoom/ex-remit

Henrik Nyh

commit sha e9ecc3965622609c7df8a6ed3e074fc7341dfd2d

Add IDs to fix phx-hook warnings Warnings like: > no DOM ID for hook "ScrollToTarget". Hooks require a unique ID on each element.

view details

Henrik Nyh

commit sha d4b1715b0a5ff4650a0789f96c91e15ea7ed9553

Navigate every time when clicking outside buttons Closes #26.

view details

push time in 16 days

issue closedbarsoom/ex-remit

Navigate back to commit on repeated click if you've navigated away

See:

  • https://auctionet.slack.com/archives/CF9SAN79V/p1592893506056800?thread_ts=1592856910.045500&cid=CF9SAN79V
  • https://auctionet.slack.com/archives/CF9SAN79V/p1592894745060400?thread_ts=1592856910.045500&cid=CF9SAN79V

closed time in 16 days

henrik

push eventbarsoom/ex-remit

Henrik Nyh

commit sha 585a67e5ea741379eaba090e0f9d833f81321a0e

Update deps

view details

push time in 16 days

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 307213a901412ecc09d25161cac64438d83c2cb7

Fix names in code example

view details

push time in 22 days

issue closedbarsoom/ex-remit

Fix comments tab to get new username when changed in settings

Should be properly fixed by #9 but we should also fix it before then.

Report: https://auctionet.slack.com/archives/CF9SAN79V/p1592892679049800?thread_ts=1592856910.045500&cid=CF9SAN79V

closed time in 23 days

henrik

issue commentbarsoom/ex-remit

Fix comments tab to get new username when changed in settings

Should have been fixed by https://github.com/barsoom/ex-remit/commit/0735536e238683c67514d6e971fbadb9bd637622 since we no longer re-mount.

henrik

comment created time in 23 days

issue closedbarsoom/ex-remit

Improve styling of multiple author avatars

Alternatives:

  • Grid
  • Cross-fade
  • Stacked with peeking, like GitHub

closed time in 23 days

henrik

issue commentbarsoom/ex-remit

Improve styling of multiple author avatars

Will close without action for now. Can revisit if it ever becomes a problem. Even three avatars side by side looks OK.

henrik

comment created time in 23 days

push eventbarsoom/ex-remit

Henrik Nyh

commit sha e03558b4dd2f3e2e926909a4c82421ef03437fb2

Update deps

view details

Henrik Nyh

commit sha 0735536e238683c67514d6e971fbadb9bd637622

Don't re-mount CommentsLive on changed params It causes a flash of empty content that doesn't look good. Instead, we `send` changed params between processes.

view details

push time in 23 days

push eventhenrik/thepugautomatic.com-eleventy

dependabot[bot]

commit sha 8ca9fd79004cfec16d2c4d390b773c5bb7379fd3

Bump lodash from 4.17.15 to 4.17.19 Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19) Signed-off-by: dependabot[bot] <support@github.com>

view details

push time in 24 days

PR merged henrik/thepugautomatic.com-eleventy

Bump lodash from 4.17.15 to 4.17.19 dependencies

Bumps lodash from 4.17.15 to 4.17.19. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/lodash/lodash/releases">lodash's releases</a>.</em></p> <blockquote> <h2>4.17.16</h2> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/lodash/lodash/commit/d7fbc52ee0466a6d248f047b5d5c3e6d1e099056"><code>d7fbc52</code></a> Bump to v4.17.19</li> <li><a href="https://github.com/lodash/lodash/commit/2e1c0f22f425e9c013815b2cd7c2ebd51f49a8d6"><code>2e1c0f2</code></a> Add npm-package</li> <li><a href="https://github.com/lodash/lodash/commit/1b6c282299f4e0271f932b466c67f0f822aa308e"><code>1b6c282</code></a> Bump to v4.17.18</li> <li><a href="https://github.com/lodash/lodash/commit/a370ac81408de2da77a82b3c4b61a01a3b9c2fac"><code>a370ac8</code></a> Bump to v4.17.17</li> <li><a href="https://github.com/lodash/lodash/commit/1144918f3578a84fcc4986da9b806e63a6175cbb"><code>1144918</code></a> Rebuild lodash and docs</li> <li><a href="https://github.com/lodash/lodash/commit/3a3b0fd339c2109563f7e8167dc95265ed82ef3e"><code>3a3b0fd</code></a> Bump to v4.17.16</li> <li><a href="https://github.com/lodash/lodash/commit/c84fe82760fb2d3e03a63379b297a1cc1a2fce12"><code>c84fe82</code></a> fix(zipObjectDeep): prototype pollution (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4759">#4759</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/e7b28ea6cb17b4ca021e7c9d66218c8c89782f32"><code>e7b28ea</code></a> Sanitize sourceURL so it cannot affect evaled code (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4518">#4518</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/0cec225778d4ac26c2bac95031ecc92a94f08bbb"><code>0cec225</code></a> Fix lodash.isEqual for circular references (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4320">#4320</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4515">#4515</a>)</li> <li><a href="https://github.com/lodash/lodash/commit/94c3a8133cb4fcdb50db72b4fd14dd884b195cd5"><code>94c3a81</code></a> Document matches* shorthands for over* methods (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4510">#4510</a>) (<a href="https://github-redirect.dependabot.com/lodash/lodash/issues/4514">#4514</a>)</li> <li>Additional commits viewable in <a href="https://github.com/lodash/lodash/compare/4.17.15...4.17.19">compare view</a></li> </ul> </details> <details> <summary>Maintainer changes</summary> <p>This version was pushed to npm by <a href="https://www.npmjs.com/~mathias">mathias</a>, a new releaser for lodash since your current version.</p> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

</details>

+33 -14

0 comment

1 changed file

dependabot[bot]

pr closed time in 24 days

pull request commentphoenixframework/phoenix

Add support to `anchor` param on router helpers

Found this PR when trying to figure out why there wasn't something built in for anchors/fragments. Makes sense not to want the ambiguity of an "anchor" (or "fragment"?) key among the params.

The least bad alternatives I can think of would be to either allow an additional keyword list or possibly a positional argument, e.g.

# Option A
Routes.foo_path(@conn, :show, 123, [my_param: "hi"], anchor: "yo")

# Option B
Routes.foo_path(@conn, :show, 123, [my_param: "hi"], "yo")

or to name the key in a way that it's highly unlikely that it'd ever be intended as a param:

# Option C
Routes.foo_path(@conn, :show, 123, my_param: "hi", phx_anchor: "yo")

# Option D
Routes.foo_path(@conn, :show, 123, my_param: "hi", "#": "yo")

I like option C for how relatively light-weight it feels (don't need to go back and add explicit brackets to a param list, or to add an empty param list if there are no params), but option A is perhaps more elegant in that it completely(?) removes any risk of param/anchor ambiguity or backwards incompatibility.

@chrismccord Are you open to any of these as a PR?

rrrcompagnoni

comment created time in 24 days

pull request commentphoenixframework/phoenix

Grammar: "Peace of mind" is not hyphenated

I read it as "Get peace of mind from prototype to production", and in that case, I believe "peace of mind" would be a noun phrase, and the hyphens shouldn't be there.

(Casting my mind back to uni linguistics classes a decade ago… I'm sure my terminology is off :D)

I agree that if it's seen as adjectival as in the second example above, the hyphens would make good sense. But I feel the "web development" would need to stay in there – that interpretation of the sentence doesn't work (to me anyway) if it's left out.

Compound adjectives could work in other cases without the modified noun being present, e.g. "Long-nosed since birth" or whatever :)

I think the difference is down to "long" actually being an adjective ("Long since birth" would also work) but "peace of mind" only becomes adjectival by modifying another noun. Like "school" in "school bus". You couldn't say "school since birth".

edjroot

comment created time in a month

delete branch henrik/phoenix_live_view

delete branch : patch-22

delete time in a month

pull request commentphoenixframework/phoenix_live_view

engine.ex docs: intercalating -> interlacing

❤️💚❤️💚❤️

henrik

comment created time in a month

pull request commentphoenixframework/phoenix_live_view

engine.ex docs: intercalating -> interlacing

My impression from looking it up is that you can intercalate a thing between others but if seemed less clear that you can intercalate two things together. And either way it’s a word I’ve never heard as a lifelong word geek, so I’m thinking it may hurt readability even if technically accurate.

But I recognise the risk of a long bikeshedding session here so I will try my best to leave it there :D Not an important change and I could happily live with either.

henrik

comment created time in a month

issue openedbarsoom/ex-remit

Revisit `@foo Application.get_env(…)` pattern

Gets env at compile-time, so maybe not a good choice in some cases, e.g. for API keys. If we e.g. change the Heroku API key, I believe it wouldn't actually change until the next deploy.

created time in a month

pull request commentphoenixframework/phoenix_live_view

engine.ex docs: intercalating -> interlacing

Maybe a woodworking term, Chris? "Dovetailing"? :D

henrik

comment created time in a month

PR opened phoenixframework/phoenix_live_view

engine.ex docs: intercalating -> interlacing

I know a lot of words but I had to look up "intercalating" :D Maybe this is clearer?

+1 -1

0 comment

1 changed file

pr created time in a month

push eventhenrik/phoenix_live_view

Henrik Nyh

commit sha 6807fe1bb52badb2fa5d099332375b2da4128bf9

engine.ex docs: intercalating -> interlacing Perhaps clearer.

view details

push time in a month

PR opened phoenixframework/phoenix_live_view

engine.ex: Fix list number in doc

Rendered fine to HTML but looks odd in its raw form.

+1 -1

0 comment

1 changed file

pr created time in a month

push eventhenrik/phoenix_live_view

Henrik Nyh

commit sha c8ceb83128760a6ff5bea45c5d89155582ee1dcd

engine.ex: Fix list number in doc

view details

push time in a month

pull request commentphoenixframework/phoenix_live_view

Clarify component docs

Force pushed. Wasn't sure about using backticks in the exception message but I liked it better than the alternatives I could think of.

henrik

comment created time in a month

push eventhenrik/phoenix_live_view

Henrik Nyh

commit sha f8a6c441a9f09c405649553f0cd875a31c70bf0f

Error message: fix typo and flesh out (#1065)

view details

José Valim

commit sha 78938dcd42d245251ac7285b2d3c855795534b09

Allow assigns as maps when setting inner content, closes #1064

view details

Henrik Nyh

commit sha 748552a024bab1965cbf6b7b5b79006e625d312c

Clarify component docs

view details

push time in a month

Pull request review commentphoenixframework/phoenix_live_view

Clarify component docs

 defmodule Phoenix.LiveComponent do    The above approach is the preferred one when passing blocks to `do/end`.   However, if you are outside of a .leex template and you want to invoke a-  component passing `do/end` blocks, you will have to explicitly handle the-  assigns by giving it a clause:+  component passing a `do/end` block, you will have to explicitly handle the+  assigns by giving it a function clause:

We should change this one too: https://github.com/phoenixframework/phoenix_live_view/blob/78938dcd42d245251ac7285b2d3c855795534b09/lib/phoenix_live_view/helpers.ex#L241

henrik

comment created time in a month

Pull request review commentphoenixframework/phoenix_live_view

Clarify component docs

 defmodule Phoenix.LiveComponent do    The above approach is the preferred one when passing blocks to `do/end`.   However, if you are outside of a .leex template and you want to invoke a-  component passing `do/end` blocks, you will have to explicitly handle the-  assigns by giving it a clause:+  component passing a `do/end` block, you will have to explicitly handle the+  assigns by giving it a function clause:

Ah, right, it's a clause in the wider sense as seen in e.g. a case statement.

Maybe "by giving it a -> clause" then?

henrik

comment created time in a month

PR opened phoenixframework/phoenix_live_view

Clarify component docs

Took me a few seconds to realise "a clause" meant "a function clause", so this could save the next person a few cycles :) Matches the phrasing in #1065.

+2 -2

0 comment

1 changed file

pr created time in a month

push eventhenrik/phoenix_live_view

Henrik Nyh

commit sha 236d8518fb4251a2669ed75e64587d394e9c7e43

Clarify component docs

view details

push time in a month

PR opened phoenixframework/phoenix_live_view

Error message: fix typo and flesh out

If you disagree with the full change, feel free to at least fix the "live_compoment" typo :)

Spotted that typo and then realised I didn't understand the error message, so I read up a little and then wrote something that I think I would have understood better.

+9 -3

0 comment

1 changed file

pr created time in a month

push eventhenrik/phoenix_live_view

Henrik Nyh

commit sha ff807b162d4581c2be8a4a7305cdd7c3670389f5

Error message: fix typo and flesh out

view details

push time in a month

issue commentphoenixframework/phoenix_live_view

Map assigns together with inner content in component causes "no function clause matching in Keyword.put/3"

I'm assuming here that a map is allowed – but my impression from other code is that it is. Or if it's not, perhaps we could catch that with a better error.

henrik

comment created time in a month

issue openedphoenixframework/phoenix_live_view

Map assigns together with inner content in component causes "no function clause matching in Keyword.put/3"

  • Phoenix version (mix deps): 0.14.1

Actual behavior

The combo of an inner content block and map (instead of keyword) assigns causes a cryptic "no function clause matching in Keyword.put/3".

Saw this in an error report by supernintendo in the Slack.

Repro below.

Changing the map to keywords, or skipping the inner content block, makes the error go away.

I suspect this is the offending code: https://github.com/phoenixframework/phoenix_live_view/blob/03b5e697d45f614188aa88094fdc680c6811c997/lib/phoenix_live_view/helpers.ex#L233-L240

Expected behavior

No error. Accepting the map as assigns.

Repro

defmodule RemitWeb.DebugLive do
  use Phoenix.LiveView

  @impl true
  def render(assigns) do
    ~L"""
    <%= live_component @socket, ListComponent, %{foo: "bar"} do %>
      <p>inner</p>
    <% end %>
    """
  end

  @impl true
  def mount(_params, _session, socket) do
    {:ok, socket}
  end
end

defmodule ListComponent do
  use Phoenix.LiveComponent

  @impl true
  def render(assigns) do
    ~L"""
    <p>outer</p>
    <%= @inner_content.(hello: "world") %>
    """
  end

  @impl true
  def mount(socket) do
    {:ok, socket}
  end
end

created time in a month

push eventhenrik/elixir

Henrik Nyh

commit sha cb1612db6fa584dc993d1fd7b52d2a31c2bfd84a

Add `Access.at!`

view details

push time in a month

push eventhenrik/elixir

Henrik Nyh

commit sha 4931a9ca8723fdbe2e6ec1251a8faa70a1e0ef57

Add `Access.at!`

view details

push time in a month

pull request commenterlang/otp

break.c: Rephrase "Eh?"

@garazdawi Just checking – does self-assigned mean you're planning on implementing this, or are you waiting for me to update the PR per @mikpe's feedback?

I don't usually work in C and wouldn't mind at all if someone else did this, but I'm also happy to give it a shot if you'd prefer :)

henrik

comment created time in a month

pull request commentelixir-lang/elixir

Add `Access.at!`

Alright, I've force-pushed those fixes though GitHub hasn't updated the PR with them yet at the time of writing.

henrik

comment created time in a month

Pull request review commentelixir-lang/elixir

Add `Access.at!`

 defmodule Access do     {nil, :lists.reverse(updates)}   end +  @doc ~S"""+  Same as `at/1` except that it raises `Access.OutOfBoundsError`+  if the given index is out of bounds.++  ## Examples++      iex> get_in([:a, :b, :c], [Access.at!(2)])+      :c+      iex> get_in([:a, :b, :c], [Access.at!(3)])+      ** (Access.OutOfBoundsError) out of bounds error++  """+  @spec at!(integer) :: access_fun(data :: list, get_value :: term)+  def at!(index) when is_integer(index) do+    fn op, data, next -> at!(op, data, index, next) end+  end++  defp at!(:get, data, index, next) when is_list(data) do+    case Enum.fetch(data, index) do+      {:ok, value} -> next.(value)+      :error -> raise Access.OutOfBoundsError+    end+  end++  defp at!(:get_and_update, data, index, next) when is_list(data) do+    if index >= length(data) do

Good catch, and makes sense 👍🏻 Thanks!

henrik

comment created time in a month

delete branch henrik/elixir

delete branch : remove-incorrect-test-arities

delete time in a month

pull request commentelixir-lang/elixir

Remove incorrect arities in test descriptions

❤️

henrik

comment created time in a month

PR closed henrik/stimulus_reflex

authentication.md: Suggest storing only the session ID string

At least in Rails 6, session.id is an instance of Rack::Session::SessionId.

Without the to_s, cookies.encrypted[:session_id] will end up storing a hash like {"public_id"=>"abc123"}, which still seems to work, but seems unnecessary.

You can verify this by putting <%= cookies.encrypted[:session_id] %> in a view template.

+1 -1

0 comment

1 changed file

henrik

pr closed time in a month

pull request commentelixir-lang/elixir

Add `Access.at!`

Force-pushed an off-by-one fix for get_and_update_in.

henrik

comment created time in a month

push eventhenrik/elixir

Henrik Nyh

commit sha fa7f546a448617594d0d3bf75c800111c06896f9

Add `Access.at!`

view details

push time in a month

PR opened elixir-lang/elixir

Remove incorrect arities in test descriptions

These tests actually use get_and_update_in/3 and pop_in/2.

I removed the arities, rather than correcting them, since it seems like unnecessary detail here.

Also, the get_in test just above does not mention arity.

+2 -2

0 comment

1 changed file

pr created time in a month

create barnchhenrik/elixir

branch : remove-incorrect-test-arities

created branch time in a month

PR opened elixir-lang/elixir

Add `Access.at!`

As discussed in https://groups.google.com/d/msgid/elixir-lang-core/3a5d1489-dfa5-4c0c-bcd1-5cb85eac2f3fn%40googlegroups.com.

This exception is a copy-paste of Enum.OutOfBoundsError. Makes me wonder if they should be joined into a single unprefixed OutOfBoundsError at some point. There is only an unprefixed version of KeyError, for example.

+78 -0

0 comment

3 changed files

pr created time in a month

create barnchhenrik/elixir

branch : access-at-bang

created branch time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha 1cec0eca1ac8dbc400aaee076071f0b275e54f22

Unbork Vim statusline after removing Syntastic

view details

push time in a month

issue commentphoenixframework/phoenix_live_view

Could the first render of components in a loop be optimised by de-duplicating?

Finally got around to actually writing the blog post that led to me opening this issue: https://thepugautomatic.com/2020/07/optimising-data-over-the-wire-in-phoenix-liveview/ :)

henrik

comment created time in a month

pull request commentrails/rails

"upgrading" guide: Rails 5.0 gotcha with disable_with

Sure. Thanks for looking!

henrik

comment created time in a month

push eventhenrik/progress_bar

Henrik Nyh

commit sha 0454261115cc95ccd7576d64b6a4f29cb222c82a

README: Fix styling in table code block

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha 6c19cd93483f1bae7abdcdf751af6dc9da86bbbd

Vim ":Lab" cleanup

view details

Henrik Nyh

commit sha 8c2b5673430b0c24bc082964cc5409a4ed5c4d6b

Vim ':Lab': Make it a scratch buffer So it's easier to quit without saving.

view details

Henrik Nyh

commit sha 711cad46ebe5e463112f44220fa902331a541d9d

Vim Elixir runner: Use augroups To avoid defining them twice when .vimrc is reloaded as described in https://learnvimscriptthehardway.stevelosh.com/chapters/14.html.

view details

Henrik Nyh

commit sha ea6dd5da7031216fe8f1aac103ccb7d2d29ccc79

Vim plugins: Use augroup in more places For reasons given in https://learnvimscriptthehardway.stevelosh.com/chapters/14.html.

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha 5250224ceada95446b89c6115909302ba1038a8c

Fix Vim plugin doc

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha 4d00e6a1ce436a6e215ad190aac0c1bbf347f5a7

Update README.md

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha 6f6e3f859d677d0b31218359a3c97d3e12d14dbf

Update README.md

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha 2686138f282b832049bfed299171b2db7b9d16c0

Update README.md

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha ede948f63cd73955fc91fd0c47591de2ce71f127

Update README.md

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha 5dca7ef52741226d446e29a54fe387fc38732cee

Update README.md

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha 6eb598961e0eda6cb6239ae2ca5b8cac8baaebf1

Update README.md

view details

push time in a month

push eventhenrik/henrik

Henrik Nyh

commit sha 09115f136d41ba4ac4d41e9e1ff01b3157e940c8

Beginnings of README

view details

push time in a month

create barnchhenrik/henrik

branch : master

created branch time in a month

created repositoryhenrik/henrik

My GitHub profile.

created time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha d79d670bbcf4f7b3ee17bc25cfaf2788a2cd1776

Remove git-submodule-rm Used it for Vim plugin management, which no longer uses submodules.

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha 0fd29c8728799ae4d782e64dcdaaa383cb8fae91

Fix fzf.vim with macOS host + Linux guest I think the previous solution would install it in the same place for both macOS and Linux, and the binary wouldn't work on the other OS.

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha c5bbb4d6f01c4f93974f83b76135a20a65691598

Cleanup

view details

Henrik Nyh

commit sha 194303acc69359d8f681b346c877c12e81b7f15a

Update plugin docs

view details

Henrik Nyh

commit sha 49c44cf481b8081b5dda2b874aab4c7a833eb6fb

Whitespace

view details

Henrik Nyh

commit sha 3d4e4b202f73d6e0ceff29f9ecbfe57858963e32

Add Vim plugin: splitjoin

view details

Henrik Nyh

commit sha d4db6dd3cc07b8e435f86f00564a364ecf69fb1e

Remove unused ackrc Don't use Ack anymore.

view details

Henrik Nyh

commit sha b1880f1fb7e7dabdd55f21c55f22e6606f8bbce3

Vim: Try vim-eunuch, replacing Remove and Rename plugins

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha f2e555cabf1470fed55025a0431d914b38bb849e

Tweak

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha a3e9316dc42ef406b92a27c14e7f8da5bde067d7

Update Vim /plugins doc.

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha fc09b50aec46c5d0545d4633db4ded232079be03

plugins.vim cleanup

view details

push time in a month

push eventhenrik/dotfiles

Henrik Nyh

commit sha 214f9c44d20fc2e93091f6ae96305aa9224448d0

Tweak gitpairs

view details

Henrik Nyh

commit sha 0c490bbbaca888a91e1ab8f7ca7d5bac73d178c1

Remove Ruby from prompt I don't think I look at this very often, and it looks weird in Elixir projects. Let's see if I miss it.

view details

Henrik Nyh

commit sha 4b615a491f76a2157cbefad1803e8409a116f568

Switch to vim-plug for plugins Git submodules are a mess. This can't be worse. Also removing some plugins I no longer use.

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 4f16240a8f4d48772e0a7cf24f6a2620e2791e61

Tweak

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 1c205922fe5032d00d7cc85adda7875dda3763ff

Tweak

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 9178b3c3623728ffabd24e1a41564a20385bf4b8

Typo

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 69612eedd1ada2fdcf4acb524aea3430cc27fc18

Tweak

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha 0dc46a287d460f0192c06e910bc0ff0606868e57

Tweak

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha af8ca7387f4363db1adfcecc3980a9fce8512c93

Typo

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha e9301bcaa66dc8bd43e0fd80e39262262d7be48a

Make footnote a larger target

view details

push time in a month

push eventhenrik/thepugautomatic.com-eleventy

Henrik Nyh

commit sha b04c32ecaaad147f45c2247a66da30e0166568d4

Use a literal ¹ for footnote 'frameworks1' didn't look great in the Twitter link card. Though I suspect that one's now cached forever… This link is a tiny tap target. Should figure out something better some day. Perhaps a "pill" style – I feel like a previous iteration of this blog had that.

view details

push time in a month

more