You have installed GPG, then tried to commit and suddenly you see this error message after it:
error: gpg failed to sign the data
fatal: failed to write commit object
Debug
| // Note: this gist is a part of this OSS project that I'm currently working on: https://github.com/steven-tey/dub | |
| export default async function getTitleFromUrl (url: string) { | |
| const controller = new AbortController(); | |
| const timeoutId = setTimeout(() => controller.abort(), 2000); // timeout if it takes longer than 2 seconds | |
| const title = await fetch(url, { signal: controller.signal }) | |
| .then((res) => { | |
| clearTimeout(timeoutId); | |
| return res.text(); | |
| }) |
I use a Mac with hugo, and have some zsh functions in my .zshrc file, to make my life easier.
I have a bunch of functions for running hugo server with different ports to keep the sites out of each other's hair. Then I have some functions for generating the sites and pushing to production.
Once you have the functions written up, you can just execute hugoserver-1 to start the local server on port 1377, in the case below, and ctrl-c to stop it. And hugodeploy-1 to generate and push to your web server via rsync.
The sample below is to make it easy to understand the gist (get it?). The ugly truth is here:
https://github.com/RickCogley/dotfiles/blob/master/zsh/zshrc
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
| Commit type | Emoji |
|---|---|
| Initial commit | 🎉 :tada: |
| Version tag | 🔖 :bookmark: |
| New feature | ✨ :sparkles: |
| Bugfix | 🐛 :bug: |
| 'use strict'; | |
| module.exports = function CustomError(message, extra) { | |
| Error.captureStackTrace(this, this.constructor); | |
| this.name = this.constructor.name; | |
| this.message = message; | |
| this.extra = extra; | |
| }; | |
| require('util').inherits(module.exports, Error); |
| var elements = document.querySelectorAll("div"), | |
| callback = (el) => { console.log(el); }; | |
| // Spread operator | |
| [...elements].forEach(callback); | |
| // Array.from() | |
| Array.from(elements).forEach(callback); | |
| // for...of statement |
Some thoughts on using node-postgres in a web application
This is the approach I've been using for the past year or so. I'm sure I'll change and it will change as I grow & am exposed to more ideas, but it's worked alright for me so far.
I would definitely use a single pool of clients throughout the application. node-postgres ships with a pool implementation that has always met my needs, but it's also fine to just use the require('pg').Client prototype and implement your own pool if you know what you're doing & have some custom requirements on the pool.