Quick Tips Tutorials
git: Remove Untracked Files
I've always said that I know just enough about git to get the job done, but also do something destructive. Nothing embodies that more than my recent mistake. I somehow found a git repository full of untracked files and
git stash
wouldn't fix it.Node isConnected
Every so often I discover a property in JavaScript objects that I didn't know existed, oftentimes using another trick to accomplish the same functionality. One such property I just learned about was
isConnected
, a node property that attached to a context (i.e.document
).Here's how to...How to Prevent Pasting into an Input
Every once in a while I get to a website that doesn't allow me to paste into a form input. In most cases it's something to do with login credentials (username and or password) and auth codes. So how are they preventing me from...
How to Create an Async Function via “new Function”
One thing I love about JavaScript is that there are many ways to accomplish the same task, one such example being creating functions. There are several patterns for functions; one of the last you see used is the
new Function
method:What if you want...Remove the Search Input Clear(x) Icon
I really appreciate the amount of different
<input>
elements we've received over the past decade. These elements don't just bring a new semantic advantage, but also provide UI helpers, which in many cases are useful. In a recent case, I found a UI element...Logical Assignment Operators
I love JavaScript, it's my favorite programming language, but I love dipping into other languages because they offer a new perspective on coding paradigms. There've been syntax additions to JavaScript that I've seen I found interesting (think
??
in optional chaining) and...Match Emojis with Regular Expressions
When experimenting with unicode property escapes, to identify accented letters in strings, it reminded me of a question I had a few years ago: what is the best way to identify and then replace emojis in a string? I first noticed this practice...
Match Accented Letters with Regular Expressions
Regular expressions are used for a variety of tasks but the one I see most often is input validation. Names, dates, numbers...we tend to use regular expressions for everything, even when we probably shouldn't.The most common syntax for checking alphabetic characters is
A-z
but what if...Binding Arguments with Bind
One of my favorite and most essential
Function
method isbind
, a function we added to MooTools when it wasn't featured in the JavaScript language itself. We often think of usingbind
to simply bind a method's call to its host object, but did you...CSS background-repeat: round
The CSS spec is full of gems that sneak their way past most of us web designers and developers. Stuff like :focus-within, prefers-reduced-motion, and prefers-color-scheme suddenly make their way into CSS without us really finding out for months or years. One such...