CWestify.com

Random projects all by Chris West.
⇩ Continue ⇩
Menu

Ace Editor Vue Component Aug 4, 2018
at 4:33PM

Making certain JavaScript UI solutions work with Vue can be a bit of a hassle at times especially if you are new to Vue. Ace editor, for example, is a great solution for developer that want to add a syntax highlighting textbox to their site but right out of the […]

JavaScript Example – YourJS.toBase() Aug 3, 2018
at 6:07PM

Recently I added toBase() to YourJS. The purpose of this function is to make a straight-forward way to convert numbers to a base (from 2 to 36). Of course you can easily use native JavaScript by using Number.prototype.toString(), but the beauty of this function is that it also lets us […]

PL/pgSQL Example – Function That Returns A Table Jul 24, 2018
at 12:39AM

One thing I started doing last week was writing PL/pgSQL functions for each of my JasperReports. Each function essentially just runs and returns the rows of a query. One question that I had for a long time was how can I return these results from a function without looping through […]

JavaScript Snippet – An Inclusive Range of Numbers – span() Jul 1, 2018
at 2:26PM

One of the things I understand but dont really like about the range(), which is available in utility libraries such as lodash and YourJS, is that it produces an array of numbers ranging from the starting number to the ending number but not including the ending number. Let’s say for […]

JavaScript RegExp – Match Any Character May 26, 2018
at 11:47PM

If you have used regular expressions in JavaScript before you probably know that you can match any non-line-terminating character with just the dot (/./). Of course, you may also want to match absolutely any character in which case you can use any of the following: Most Common: /[\S\s]/ This is […]

PostgreSQL – Most Recent Week Day May 6, 2018
at 2:52PM

Most Recent Week Day Recently I was reviewing someone’s code for a function in PostgreSQL and I saw a block that was supposed to calculate the most recent Friday of the week. After working on improving it I came up with the following queries that will show the most recent […]

Excel to CSV, TSV and JSON Converter Apr 29, 2018
at 1:13PM

I recently finished creating a Desktop application that can converter Excel files into CSV, TSV and JSON files. This application allows you to select a root folder containing all of the Excel files that you want to convert then you can convert all of the sheets in each Excel file. […]

JavaScript Snippet – suffixFileSize() Apr 6, 2018
at 11:04PM

If you would like to convert the amount of bytes (or bits) into the corresponding measure when the size is a kilobyte or bigger (or a kilobit or bigger) you can use the following JavaScript function: Here are some examples of using it: // Convert bytes console.log(suffixFileSize(1023)); // 1023 B […]

Google Sheets Data As JSON & JSONP Mar 25, 2018
at 12:14AM

Google Sheets is a pretty simple way to make free spreadsheets and to quickly store data. Did you know that you can actually retrieve this data via JSON & JSONP? Here’s how you can do it in just a few easy steps: Open the desired Google Spreadsheet. Go to File […]

JavaScript Snippet – isPowerOf(x, base) Mar 20, 2018
at 8:48AM

After reading this reddit entry I decided to write up a little snippet with documentation: Feel free to use it whenever and wherever. Happy coding! 😎