I use a GPG key to sign my git commits.
An error like this one might be a sign of an expired GPG key.
error: gpg failed to sign the data fatal: failed to write commit object
| // Add any other logic here as needed. | |
| import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin'; | |
| import { CacheFirst } from 'workbox-strategies/CacheFirst'; | |
| import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL'; | |
| import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin'; | |
| import { NavigationRoute } from 'workbox-routing/NavigationRoute'; | |
| import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute'; | |
| import { registerRoute } from 'workbox-routing/registerRoute'; |
| var accounts = [ | |
| { name: 'James Brown', msgCount: 123 }, | |
| { name: 'Stevie Wonder', msgCount: 22 }, | |
| { name: 'Sly Stone', msgCount: 16 }, | |
| { name: 'Otis Redding', msgCount: 300 } // Otis has the most messages | |
| ]; | |
| // get sum of msgCount prop across all objects in array | |
| var msgTotal = accounts.reduce(function(prev, cur) { | |
| return prev + cur.msgCount; |
| /** | |
| Problem: | |
| You have a javascript array that likely has some duplicate values and you would like a count of those values. | |
| Solution: | |
| Try this schnippet out. | |
| */ |
| /* | |
| * Handling Errors using async/await | |
| * Has to be used inside an async function | |
| */ | |
| try { | |
| const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
| // Success 🎉 | |
| console.log(response); | |
| } catch (error) { | |
| // Error 😨 |
Steps to deploy a Node.js app to Digital Ocean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a
I will be using the root user, but would suggest creating a new user