Blog
Emoji Search
Unicode now offers plenty of emojis that we can add to our code to show on our web pages or web applications. Below is quick-and-dirty emoji search I wrote based on this page from FileFormat.info:
Unicode now offers plenty of emojis that we can add to our code to show on our web pages or web applications. Below is quick-and-dirty emoji search I wrote based on this page from FileFormat.info:
Now Available in YourJS Recently I was working on a function which needed to determine whether or not a string could be used as a variable name. Variable name validation can get tricky so instead of using a crazy regular expression which includes all keywords (which may change over time) Read more…
Two years ago I wrote a post about how to pass arguments by name in JavaScript. Recently I have started to ramp a new project call YourJS and found a need to be able to read the names of the parameters of the given function. The following getParamNames() function takes Read more…
WARNING: Extending native prototypes is frowned upon by many JS engineers but can be helpful as long as the extensions are properly documented in the codebase. SCRIPTER’S DISCRETION IS ADVISED. 😆 Yesterday I added a post about String.prototype.before(...). As is explained within the post, this function can be used to Read more…
WARNING: Extending native prototypes is frowned upon by many JS engineers but can be helpful as long as the extensions are properly documented in the codebase. SCRIPTER’S DISCRETION IS ADVISED. 😆 Even though its NOT encouraged to extend native prototypes, at times you may find that doing so is pretty Read more…
Today, I had to figure out a way to parse an HTML string in Python in order to find all of the attribute values of attributes starting with a specific string. Since we already have BeautifulSoup installed, I started researching how to use a lambda function in conjunction with the Read more…
As I mentioned in yesterday’s post, I was recently working on a quick way to parse CSVs into an array of arrays and alternatively into an array of dictionaries keyed on the values in the first row. I ended up landing on the following definition: As you can see the Read more…
A few days ago I was working on a very primitive version of a CSV reader for a quick JS project and while testing my regex out, I noticed that I was getting an extra match at the end. Here is the JavaScript function that I had: Interestingly, if you Read more…
Last year I wrote about having heredoc like strings available in JavaScript. Today I figured i’d briefly bring the topic back, providing a solution for returning an array of all comments found in a function: Why is this useful? As you may know, writing multiline strings in JavaScript isn’t always Read more…
Probably due to it being so late, I was looking for code to uncamelize (undo camel-casing) any string. I came across what claimed to be a solution in PHP but unfortunately did nothing but lowercased my string. Therefore I decided to write my own solution: Believe it or not, the Read more…