TIL: Typescript Basics
Typescript:
Articles about til.
Typescript:
Need to change a variable name across 50 files in 10 folders? Here's how to grep for that variable in .cfc files:
Whoa! You can do getter and setter functions in native Javascript? How cool is that!
Trying to rename a column today in an MSSQL database. I expected the standard ALTER TABLE x CHANGE oldColumn newColumn <type> to work, but apparently that's a MySQL-only thing? Instead I did a quick Google search and came up with this nugget:
So, CFLint is super useful for CF development. There's a VS Code Extension which can lint your CF tag or script syntax on the fly, and there is also a CommandBox Package which can lint an entire folder of .cfm or .cfc files.
Trying to retrieve records by modifiedDate, right?
I've been working with Oracle lately, and the first Oracle-specific thing I had to do was check the version.
Why would you ever want to stash a specific file, as opposed to any and all altered files, you ask? In an ideal world, you probably wouldn't need to. In this specific case, I was attempting to stash files I had modified without stashing other files which had been bulk-edited by a script. In other words, I wished to throw away most of my changes and keep one or two specific changes after a git merge.
I did something pretty stupid a week or two ago. I was setting up a MariaDB database using Docker-compose, and I kept getting an error saying that MYSQL_ROOT_PASSWORD was not set. This made no sense to me - of course MYSQL_ROOT_PASSWORD is in the .env file, right?
So I've had this docker container hanging around my Ubuntu machine since I first developed/started it. It's there whenever I run docker ps, and I finally decided I need to stop this useless container from hogging my machine's memory. (After three months!)
Where chr(10) is the myDateField column type to expect and 103 is the date format to use. The 100-plus date format codes will display a 4-digit year, whereas the 0-100 codes will display a 2-digit year. (Not recommended, if you ask me!)
First, see this quote from Modify Unique Constraints:
For all those MySQL devs who miss the simplicity of SHOW CREATE TABLE myTable or SHOW COLUMNS FROM myTable, here's the snippet you are looking for.
So, I ran into a "funny" sorting issue this week. Turns out there was a <TAB> in a product title, causing that title to be sorted first. (Quite logic if you look at the ASCII table.)
Turns out that running mysqldump against a database takes more than just SELECT permissions. Use this GRANT command to grant the necessary privileges for dumping a database.
So, I just re-installed Ubuntu on my dev machine. (18.04, whoop whoop!)
So, I'm building a Formstack API extension for the marvelous Bolt CMS, and I decided to use Josh Gulledge's 'FormStackAPI` PHP integration.
See the quick tutorial on SuperUser.
No explaning here. I've got a branch in my repo, want to get rid of it.
Yo, ever seen this?
Doing a big (ok, small) script to check for SSL certificates on a list of about 200 of our client websites.
I'm working on a project which has thousands of lines of Coldfusion written with tabs. (Now's not the time to start that argument again!) I'm obviously not keen on throwing 2 spaces in the mix for indentation, so I looked up a way to override indentation for .cfm and .cfc files only.
I hadn't realized this until today: MySQL views can't have indexes!
So, I was getting this error message in a new cron job / nightly import I'd set up.
Ach! I over-committed! (heh, heh, joke, joke.)
My Foundation theme was showing the sidebar even when the sidebar was totally empty. This caused some wonky-looking main content which was shifted to the left, making room for the useless (and invisible) sidebar.
So, I'm grabbing argument number three.
Wow! This was a royal pain. See Mozilla bug report for Firefox print mode.
Making a "Print page" button. You know the drill. Use addEventListener(), pass a callback function.
This was frustrating. I couldn't track changes to multiple files buried in a folder!
Ugh. So I saw a bug logged today due to a missing piece of code. What?! That was there yesterday! Turns out I had deleted the file by accident and not realized it.
So after writing all about my fancy new shell prompt, I had to adjust it a little. I knew I'd gotten it wrong when I started seeing my shell commands wrap before they reached the end of the window.
Ran into this today. Debugging a Coldfusion app on IIS, I'm having trouble getting any errors, despite having a nice Coldfusion error handler set up.
Ok, so I use VS Code with an integrated terminal on the right. My terminal is really narrow, so I run out of room quickly. My bash prompt can overflow the narrow screen, so I decided to change it.
Using the Wordpress "Theme My Login" plugin to display a nice login form on a custom dashboard page. The form by default displays a "Log In" message, but what I'd like to see is "Please log in to view your application status".
So, my machine at work is less Vim-ified than my lean, mean, Ubuntu machine at home. When I tried searching for a variable (like /$applications), I couldn't immediately see the matched strings, meaning I have to skip to each match with n.
After installing WP Job Manager on a careers-focused Wordpress site, I needed to set up a job search form. This search form would allow users to enter in a job title, keyword, etc to search the jobs on the site. Clicking "Go" would bring them to the job listing page.
I thought I was a pretty good database developer. I wouldn't call myself a DBA or a "guru", but I would have put myself in the upper 50%.
Ok, so this is nothing mind-blowing. I may spend a lot of time in bash, but very little of that goes into writing scripts. Well, today I was downloading websites using a wget script I wrote specifically for that purpose, and had to add an if statement to construct some conditional wget arguments.