跳到主要内容

The apps (on Mac) that I cannot live without

· 阅读需 1 分钟
Daniel G
Developer

Maccy

Maccy is a lightweight clipboard manager for macOS. It keeps the history of what you copy and lets you quickly navigate, search, and use previous clipboard contents.

Project site: https://github.com/p0deje/Maccy.

Features:

  • Open source and free
  • Keyboard-first
  • Lightweight and fast
  • Secure and private
  • Options to past automatically and paste without formatting
  • It can ignore applications like password managers

Hammerspoon

It is an open source tool for powerful automation of OS X. You can write Lua scripts to control many aspects of your OS X environment.

I mainly use it to configure global shortcuts for applications (my config).

Project site: https://github.com/Hammerspoon/hammerspoon

Vim

Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient.

I use Vim whenever possible, for example: VS Code (Cursor), Sublime Text, Intellij Idea etc (my config).

Project site: https://github.com/vim/vim

How to download all files in a S3 bucket folder

· 阅读需 1 分钟
Daniel G
Developer

Let's say we have a S3 bucket demo_bucket, and we have folder path under that bucket: public/emails/templates. I have 30 files under that path and I want to download all files. In the AWS console, we can only download one file each time.

We can use the AWS CLI to download all the files:

aws s3 cp s3://demo_bucket/public/emails/templates/ .  --recursive

Process JSON data using `jq`

· 阅读需 2 分钟
Daniel G
Developer

JSON is a widely used exchange format and we have many opportunities to process JSON data in daily work.

jq is a flexible and popular command-line JSON processor. It's very helpful to transform JSON data.

Here are my practical examples using jq to process JSON data.

The example JSON data (input.json) is like:

[
{
"id": "0c1160b4-42c9-4aee-8287-68b0cf03ebda",
"billingId": "54bdc967-0132-4cf2-9a9e-67d0230f7cce",
"requestBy": "6b303448-4010-4ab8-a3dc-30bbd4145475",
"paymentType": "DIRECT_DEBIT",
"createdAt": "2024-06-11T23:22:54.777Z",
"refundAmount": 29.9,
"refundDate": "2024-05-30",
"updatedAt": "2024-06-11T23:22:54.777Z"
},
{
"id": "4fa36c92-a1c1-44be-bd5e-f0697fd91420",
"billingId": "4f13d5f9-d0d9-470f-8e98-d5c6a37ac428",
"requestBy": "6b303448-4010-4ab8-a3dc-30bbd4145475",
"paymentType": "CREDIT_CARD",
"createdAt": "2024-06-11T23:22:54.777Z",
"memberId": "52dd5dfc-82d2-526f-b3ef-f0df008eb37a",
"refundAmount": 13.0,
"refundDate": "2024-05-30",
"updatedAt": "2024-06-11T23:22:54.777Z"
},
{
"id": "3ff9266a-18f6-4473-ac9c-ac99d28c608e",
"billingId": "4823b60d-79ca-411b-a993-9d9b3d4f2350",
"requestBy": "6b303448-4010-4ab8-a3dc-30bbd4145475",
"paymentType": "CREDIT_CARD",
"createdAt": "2024-05-11T23:22:54.777Z",
"memberId": "9f993c23-e3ab-4a65-93ed-5fe4c343843c",
"refundAmount": 38.0,
"refundDate": "2024-06-30",
"updatedAt": "2024-06-28T23:22:54.777Z"
}
]

Different ways to deploy an node.js application to AWS

· 阅读需 5 分钟
Daniel G
Developer

Discussion

We have a Node.js application providing REST and/or GraphQL APIs, which is part of the microservices architecture. What are the possible ways to deploy the application to AWS?

And what's the pros and cons for each approach?

Elastic BeanStalk

AWS Elastic Beanstalk is a Platform as a Service (PaaS) that makes it easy to deploy, manage, and scale web applications and services. It automatically handles the deployment, from capacity provisioning, load balancing, and auto-scaling to application health monitoring.

Pros:

  • Ease of Use: Simplifies deployment and management, ideal for those less familiar with AWS infrastructure.
  • Managed Service: Handles the underlying infrastructure, including servers, load balancers, and scaling.
  • Integration: Well-integrated with other AWS services.

Cons:

  • Limited Control: Less granular control over the underlying infrastructure compared to managing your own instances.
  • Cost: Can be more expensive than manually managing instances, depending on your application’s requirements and usage.

Use Case: Best for developers looking for a quick and easy way to deploy and manage applications without deep knowledge of AWS infrastructure.