Posts

Debugging Jasmine tests on Windows 10 in Visual Studio Code

This is surprisingly harder than it looks.  The solution is to avoid, AT ALL COSTS, referencing node_modules\\.bin\\jasmine.  It simply does not work.  Instead, use the path in the 'program' property as seen below (the 'args' property is optional & present to just run one test): { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "node", "request": "launch", "name": "handleEvent.spec.js", "program": "${workspaceFolder}\\node_modules\\jasmine\\bin\\jasmine.js", "args": [ "${workspaceFolder}\\spec\\handleEvent.spec.js" ] } ] }

Deploying AWS Lambdas with an NPM script or bash

Requires: AWS CLI ( https://aws.amazon.com/cli ) installed and working. Update December 2020 : use this bash script instead. This the best version of the script so far.  Updates / improvements welcome. You can get the ARN from the AWS website or you can run this code:   aws lambda get-function --function-name <functionNameGoesHere> | grep FunctionArn Then edit your package.json such that the "scripts" portion looks like this (append to, don't overwrite, existing keys):   "scripts": {     "deploy": "aws lambda update-function-code --function-name arn:some-crazy-numbers:function:hello-world --zip-file fileb://lambdaDeployment.zip",     "predeploy": "rm -f lambdaDeployment.zip; zip -r lambdaDeployment.zip * -x *.git* *.zip package*.json *.log '*node_modules*' '*.DS_Store' '*spec/*'"   }, OR, if you have all of your files in a 'src' directory, use these:   "scripts...

Deleting empty AWS Elastic Beanstalk S3 buckets

Read from https://forums.aws.amazon.com/thread.jspa?threadID=145366 [empty the bucket] Go to the bucket's policy (bucket --> properties --> permissions --> edit bucket policy) Then find this statement { "Sid": xxxxxxxxx, "Effect": "Deny", "Principal": { "AWS": "*" }, "Action": "s3:DeleteBucket", "Resource": xxxxxxxxxx } Change the Effect from Deny to Allow. Save the change to the Bucket Policy. Now right click on the bucket and press delete.

SQL is just SQL . . . until it isn't

Image
My latest project is a web application that tells you the asset allocation ofyour investment portfolio .   Happily, I just finished getting my Exam 70-761: Querying Data with Transact-SQL certification, so I thought that I’ll use a SQL database for the project.   One of the cooler features that I learned about while studying for my exam is a feature called temporal tables .   Temporal tables allow you to see what the data used to look like. It's a feature that is baked in to SQL Server 2016 and has been ANSI standard since 2011.  I thought that they would be really useful feature to show how the asset allocation changed over time.   Want to see what your portfolio looked like at the end of 2012?   Great Scott!! With temporal tables, you can!! Unfortunately, they aren’t standard in PostgreSQL.  PostgreSQL is my DB engine of economic necessity, and it doesn't support temporal tables out of the box (there are extensions that you can use ...

What do you want to use it for? – 2 minute read

I’m always working to improve my code.    One of the ways that I do this is that I frequently work on Code Wars practice problems.   I was working on a   prime number generator   for a practice problem (if   you’re interested, the code is here: https://github.com/tmurphree/node-utilities/blob/master/primeNumberGenerator.js)   and I wondered, “Should I use a set or an array?” I solved the problem with both a set and an array, and I ran some tests* to see   how long the function took to run and how long the   searches on the results took.    The results were interesting: Operation Average time (ms) Array generation 18.2412 Set generation 44.3016 Array seek 0.021 Set seek 0.0099 The set took about 2.4x the time to generate as the array, but it is searchable in about 1/2 the time.  So the answer to the question  “Should I...

Know your options - 1 minute read

I just read a post from another developer about front-end frameworks and whether or not they're worth the trouble.  The conclusion: they're worth the trouble sometimes.  The best solution is to know your options and use them when appropriate.

There’s a solution for that! It's called, 'lots of time.' – 2 minute read

Image
One of the best investments that I made this year is a subscription to www.safaribooksonline.com ,   an online  l ibrary for technical books.    I’m working my way through the videos for Querying Data with Transact-SQL - Exam 70-761 Certification Training by Mark Long.   I got a good laugh from one of his comments: while talking about how important it is for database developers to have a good knowledge of the data that they’re working with, he said, “There’s is a solution for that!   It’s called ‘lots of time.’    After you spend lots of time with your data set, you get to know it better and better and become more proficient.” Well, I recently had a slightly different problem:   I wanted to install Node.js 8.9.1 (the current LTS version) on my Ubuntu laptop.    Since most of my OS knowledge is on Windows, I simply wasn’t able to get it to work. Then I remembered Mark’s wisdom: “There’s is a solution for that!   It’s...