Tag: JavaScript
-
React Draft Wysiwyg with MongoDB
We love open source software here at CrowdSync. Sometimes though, we run into issues with the software we’ve deemed as the “right” package for us. A recent incident has been with React Draft Wysiwyg which we decided to use as part of our action to compose and send emails to…
-
How to calculate Mother’s Day in JavaScript
One of my favorite features of PHP is the strtotime function. It takes a string and gives you the equivalent time in return. Unfortunately, there’s not something similar for other languages. There are other ATTEMPTS to duplicate the function, but nothing I’ve ran into that works quite as well. With…
-
How to calculate Easter Sunday in Javascript
Regardless of your religious beliefs, you are probably aware that Easter Sunday occurs on a sliding scale. This is because Easter is a moveable feast and the date is determined by a lunisolar calendar. Originally I was planning to talk about how to calculate the date of Easter in Javascript….
-
How to capitalize the first character of each word in a string in Javascript
The other day I had posted on capitalizing the first letter of a string in JavaScript. But what if you wanted to capitalize the first letter of every word? With PHP it’s just a simple call to ucwords and just as easy in Ruby and Python. To be able to…
-
Multiple buttons with Hubspot’s Vex
I’ve been implementing HubSpot’s Vex library as a replacement for stock alert(), confirm() and prompt() dialogs on SceneKids recently. In one use case, I wanted to be able to have 3 buttons on the dialog with each button returning a value, instead of just boolean true for the OK buttons….
-
How to Capitalize the First Letter in a String in JavaScript
I’m still kind of spoiled by the built-in functions in PHP (as well as Ruby and Python for this particular task). Something like capitalizing the first letter of a string is a trivial task in most languages: <?php // Capitalize first letter with PHP ucfirst(‘some string that needs the first…
-
Outline numbering for an object tree
Last week I had talked about a layout dilemma that my buddy Justin was having. This reminded me of an issue that programming challenge he hit me with a few months prior. The challenge was to take an object tree and generate the proper outline numbering for it. The object…
-
Handling click and touch events on the same element
I’m starting to feel behind the curve. I started receiving feedback that some clickable elements on my social networks were not working on touch devices. Without much thought, I went ahead and added touchstart along side of click to bind both events: $(document).on(‘click touchstart’, ‘.feeny’, function(e) { alert(‘Believe in yourselves….
-
The cost of convenience
Convenience is rarely economical. Shredded cheese tends to be more expensive than a block of the same type. Pre-chopped vegetables are the same way. But when you spend that little extra, you gain that back in time that you don’t have to spend doing the prep work. Technology doesn’t always…
-
jQuery plugin to calculate read time
I love hosting my blog on GitHub by way of Jekyll but the Liquid templating system is far from a robust scripting language in my opinion. With the rise of Medium, I’ve been seeing the read time on more and more articles and figured it was time to add the…