Skip to content

Instantly share code, notes, and snippets.

View ansarbek's full-sized avatar

ecomarine ansarbek

  • Almaty
View GitHub Profile
@Rich-Harris
Rich-Harris / footgun.md
Last active May 6, 2024 10:24
Top-level `await` is a footgun

Edit — February 2019

This gist had a far larger impact than I imagined it would, and apparently people are still finding it, so a quick update:

  • TC39 is currently moving forward with a slightly different version of TLA, referred to as 'variant B', in which a module with TLA doesn't block sibling execution. This vastly reduces the danger of parallelizable work happening in serial and thereby delaying startup, which was the concern that motivated me to write this gist
  • In the wild, we're seeing (async main(){...}()) as a substitute for TLA. This completely eliminates the blocking problem (yay!) but it's less powerful, and harder to statically analyse (boo). In other words the lack of TLA is causing real problems
  • Therefore, a version of TLA that solves the original issue is a valuable addition to the language, and I'm in full support of the current proposal, which you can read here.

I'll leave the rest of this document unedited, for archaeological

@alexpchin
alexpchin / Rails_Generating_and_Scaffolding.md
Last active April 2, 2024 12:24
Rails Generating & Scaffolding

Rails Generating & Scaffolding

Rails' use of strict naming conventions means a lot of core code SHOULD be in the same format whoever writes it? It could be written by a friend, colleague or a computer... it shouldn't matter because the same Rails rules apply to everyone.

This means that Rails can actually do some tasks for you! It can actually build things and write code on your behalf...

Coming from another language like PHP, this can seem like magic.

@haslinger
haslinger / 0002 Live CKEditor in Hobo.markdown
Last active September 22, 2016 17:48
Live CKEditor in Hobo

Live CKEditor in Hobo

This in a quite ugly hack ... but its working ...

It is actually quite easy to enable inline editing in Hobo using Clickeditor, which is awesome. It is also possible to use Ckeditor in Hobo, which is awesome as well.

There is even some integration between the two, so clicking on a cktext-attribute unhides the already embedded CkEditor. But unfortunately, you can't save, there isn't even a save button.