Snippets are one of my favorite parts of programming. The shear endless depth of command line
tricks and customizations is so exciting! Here is a collection I maintain for myself to comeback to.
update npm packages to latest versions
-- 15.06.2022
%
I was doing some housekeeping on a Node.JS project today. Wanted to update all
the dependencies to their latest versions. At first I tried npm update but
come to find out that is ment more for upgrading single packages and not
major versions. In the end after some googling I found
npm-check-updates.
To upgrade the dependencies of a project without installing anything else I ran:
$ npx npm-check-updates -u
It updated the package.json so it must be followed up by a:
$ npm i
Which will install the new packages and update the package-lock.json.
Got a new Macbook Pro with the start of my new job and I love it. Except. It did
not come with and english keyboard. Now every time I try to type the backslash (`)
or tilde (~) instead I get “§” or “±” 😔. Lucky for me there are a bunch of people
with the same issue.
Before changing laptops I backed up all my personal projects to my NAS. When I
transfer them back the file modes got messed up and a git status returned
this:
diff --git a/docker/Dockerfile b/docker/Dockerfile
old mode 100644new mode 100755diff --git a/lib/DeployTool/CLI.rakumod b/lib/DeployTool/CLI.rakumogpg --list-secret-keys --keyid-format LONG <EMAIL>d
old mode 100644new mode 100755diff --git a/lib/DeployTool/Config.rakumod b/lib/DeployTool/Config.rakumod
old mode 100644new mode 100755
Just moved computers and thus moved my pass store. After importing
my gpg keys, explained in this snippet, I had to trust them in order to stop the annoying
warnings everytime I created a new password.
Started new job this week and I wanted to have a seprate email on my work related repos then my
personal ones. Cool thing is git supports
conditional config file includes!
Recently I was testing an IOS app on my wifes phone. The UI was completly broken.
Turns out she had dark mode enabled. That led me down the path of adding dark mode support to the
app. Which is testable via the Xcode simulator if you know how to enable it.
Working on my Oblastle game today. In an effort to standardize the way I store images for the game in S3 I needed to move all the files with key image-service/images/oblastle/flags/ to /image-service/images/oblastle/flag/.
Here is how I did it:
$ aws s3 mv s3://travisshears.images/image-service/images/oblastle/flags/ s3://travisshears.images/image-service/images/oblastle/flag/ --recursive --profile personal
Where were you –recursive when I was hacking around with
for file * ; do aws s3 cp $file…..
$ aws s3 cp ./ s3://travisshears.images/image-service/images/oblastle/context/ --profile personal --recursive
upload: ./us-ak.jpg to s3://travisshears.images/image-service/images/oblastle/context/us-ak.jpg
upload: ./us-co.jpg to s3://travisshears.images/image-service/images/oblastle/context/us-co.jpg
upload: ./us-ar.jpg to s3://travisshears.images/image-service/images/oblastle/context/us-ar.jpg
upload: ./us-ca.jpg to s3://travisshears.images/image-service/images/oblastle/context/us-ca.jpg
upload: ./us-al.jpg to s3://travisshears.images/image-service/images/oblastle/context/us-al.jpg
upload: ./us-ct.jpg to s3://travisshears.images/image-service/images/oblastle/context/us-ct.jpg
...
–recursive is an easy win to upload a bunch of files to s3.