Creating a simple babel plugin1 min read

What will it do? It will change this let content = include_str('path to text file'); to this let content = 'content of text file'; It works just like the rust-lang  include_str!() macro. Code While looping through the AST, our code checks for a function call ( CallExpression ) named include_str If one is found, we derive the required file path from the first argument to the call and the path […]

HTML custom input with type hidden and number1 min read

I don’t think it is possible to a create an element like

Solution is to create a custom element like this

MDN – Using Custom ELements (https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)

To add a property of value to our <hidden-num> element, we must add the get value()  and set value(val)  methods. An attribute of value is also added […]

RUST: non-exhaustive patterns: `&_` not covered pattern `&_` not covered21 sec read

Tried something like this

Error non-exhaustive patterns: &_ not covered pattern &_ not covered What I thought was wrong I thought it meant you cannot match references What the real error was Just had to add all possibilities in match statement