Need to setup gpg-agent first, on OSX I use keychain (it also does ssh-agent)
$ brew info keychain
keychain: stable 2.8.5
User-friendly front-end to ssh-agent(1)
https://www.funtoo.org/Keychain
/usr/local/Cellar/keychain/2.8.5 (7 files, 108.5KB) *python main.py data.jsonRust error handling is nice but obligatory. Which makes it sometimes plenty of code.
Functions return values of type Result that is "enumeration". In Rust enumeration means complex value that has alternatives and that alternative is shown with a tag.
Result is defined as Ok or Err. The definition is generic, and both alternatives have
The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.await import(…) from CommonJS instead of require(…).| /* | |
| Want to know when ECS events happen in Slack? Try this. | |
| (1) Create a new Slack app with an incoming webhook, save the webhook URL | |
| (2) Create an SNS topic called something like ECSEvents | |
| (3) Create a CloudWatch Rule that publishes all ECS events to the topic | |
| (4) Create a Node.js Lambda that is triggered by the SNS topic | |
| (5) Add a WEBHOOK_URL environment variable to the Lambda with the webhook URL | |
| (6) Paste this code into index.js | |
| (7) Paste the contents of https://unpkg.com/node-fetch/lib/index.js into fetch.js | |
| (8) Deploy and enjoy |
| import { TwitterApi } from 'twitter-api-v2'; | |
| const rl = require('readline'); | |
| const APP_INFOS = { appKey: 'XXX', appSecret: 'YYY' }; | |
| const readline = rl.createInterface({ | |
| input: process.stdin, | |
| output: process.stdout | |
| }); |
| /* | |
| Assuming you have a blog Posts table with the following structure: | |
| { | |
| // hash key | |
| "id": 154325, | |
| "title": "Things you need to know before going bouldering for the first time.", | |
| "text": "...", | |
| // represents unix time of a moment this record was locked at | |
| "lockedAt": 1684067555 | |
| } |
| # Find | |
| import\s(([^;]|\n)*)\sfrom\s(['"])(\.{1,2}\/.*)(?<!\.js)(?<!\.(css|pdf|png|jpg|jsx|mjs|mp3|mp4|svg|ttf))(?<!\.(avif|json|webm|webp|woff))(?<!\.woff2)(['"]); | |
| # Replace with | |
| import $1 from $3$4.js$7; |