MacOS screenshot: windows with drop shadows

I might be late to this party to realize this since when I take screenshots of things I normally drag to select what it is that I want to capture. As I was taking a screenshot of some windows on MacOS Monterey I used the ‘capture window’ option and was surprised the screenshot of a window is captured preserving the dropshadow in the image:

I don’t know why I should be surprised by this, but wow, attention to detail is everything. That looks fantastic.

Adobe Creative Cloud – Native M1 or Rosetta?

Attempting to download Adobe Creative Cloud app for my new MacBook Pro M1Pro I seem to have found my first non native M1 app, and I’m prompted to download Rosetta:

If just the Creative Cloud app needs Rosetta but Photoshop is native then I’m ok with that, but thing I need to do some reading to confirm what versions are available and try installing again

Deploying changes to individual Lambdas using Serverless Framework

I have a serverless project that deploys 2 Lambdas in the same stack:

service: example-apis2

provider:
  name: aws
  memorySize: 512
  region: us-west-1
  apiGateway:
    restApiId: ${env:APIGWID} #  API Gateway to add this api to
    restApiRootResourceId: ${env:RESOURCEID}
functions:
  example2:
    handler: index2.handler
    layers:
      - arn:aws:lambda:us-west-1:[myaccountid]:layer:example-layer:1
    events:
      - http:
          path: api2
          method: get
  example3:
    handler: index3.handler
    layers:
      - arn:aws:lambda:us-west-1:[myaccountid]:layer:example-layer:1
    events:
      - http:
          path: api3
          method: get

After first deploy, if I do

aws lambda get-function --function-name example-apis2-dev-example2 
...
"LastModified": "2021-10-27T06:30:31.002+0000",

and

$ aws lambda get-function --function-name example-apis2-dev-example3
...
"LastModified": "2021-10-27T06:30:31.987+0000",

Now if I make a code change only to the example 3 Lambda and redeploy only that function with:

serverless deploy function -f example-apis2-dev-example3

… example2 has not been modified since the first deploy (same timestamp as the original deploy):

$ aws lambda get-function --function-name example-apis2-dev-example2
...
"LastModified": "2021-10-27T06:30:31.002+0000",,

and only example3 shows it was updated/redeployed:

$ aws lambda get-function --function-name example-apis2-dev-example3
...
"LastModified": "2021-10-27T06:33:17.736+0000",

serverless deploy : deploys the whole stack (but if nothing has changed there is no update)

serverless deploy function -f functioname: updates just the code on that one Lambda (and updates in a couple of seconds vs several seconds for updating the whole stack).

This is described in this article here.

Moving a git ‘master’ branch to ‘main’

By default, the git install on my MacOS 11.5 creates new projects with a ‘master’ branch, but GitHub which I push to for my remote projects has been creating new projects with a default branch of ‘main’ for some time now.

To move a master branch to main locally, set it as the default branch and then push to GitHub I use the following steps (taken from multiple places but mainly from this article):

Create a new main branch from master locally:

git branch -m master main

Add remote GitHub repo:

git remote add github https://your-repo-url

Pull remote changes from remote main branch

git pull github main

Set upstream branch to track main

git branch  --set-upstream-to github/main

Push local to github main

git push github main

If you have changes in the new remote project (like a readme) that don’t exist locally yet and you get the error: “fatal: refusing to merge unrelated histories” then pull with the allow unrelated histories option:

git pull github master --allow-unrelated-histories

Now:’git push’ and you should be good.

For my local development these steps are enough for what I need, but if you have a master in your remote repo too and want to delete it there are additional steps in the article linked above.