You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Ichim David
ichim-david
I'm a web developer who digs javascript and loves to be part of https://github.com/plone
community. Volto Core team member https://github.com/plone/volto/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comments on optimizations around string concatenation.
Note: The code links are to CPython 3.8.5, the most recent release when this was written.
I was recently asked about a performance optimization in CPython around using += and + for string objects.
As some people may already know, if you use += or + a string, it can sometimes be just as fast as ''.join.
The question was to explain when that optimization couldn't be performed.
We will be going through the following example scenarios:
“In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”
Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows.
(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)
So the big deal about css-in-js (cij) is selectors.
Frontend Masters—Deploying Full Stack: Node.js & React on AWS
You should have the following completed on your computer before the workshop:
Have Node.js installed on your system. (Recommended: Use nvm.)
Unfortunately, you'll need to be on Node 9.x or earlier. Dependencies are hard and one of the dependencies of one of our dependencies is set to not allow Node 10.x.
Install yarn with brew install yarn.
Create an AWS account. (This will require a valid credit card.)
Install multi-factor authentication app (e.g. Authy, Google Authenticator, Duo).
Install the AWS CLI. (brew install awscli should do the trick. Otherwise, you'll need Python and PIP, which you can install using brew install python.)
Rename and move Plone/Zope objects without triggering events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just some notes about my attempt to upgrade to webpack 4
If you enjoyed reading this, I'm intending to do more blogging like this over here: https://cdgd.tech
This is not a complaint about Webpack or v4 in any way. This is just a record of my process trying it out so I could provide feedback to the webpack team
Hmm... I don't see any docs for 4.0 on https://webpack.js.org. I guess I'll just wing it.
All I need to do is npm i -D webpack@next, right?
Remember not to snooze, get some natural light on your face, and turn on as many lights as you can to signal to your body that it’s time to be awake. If you don’t shower immediately, try washing your face right after getting up to help your eyes feel more awake, too.
Rendering pages server-side with Express (and Pug)
Terminology
View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti