DEV Community

Cover image for A good code snippet for your posts 💻
Nico Montiel
Nico Montiel

Posted on • Edited on

A good code snippet for your posts 💻

I just want to share with you a cool tool that I have been using a lot lately called "Carbon". It allows you to create and share beautiful images of your source code.

Image of Carbon landing page

This is pretty useful if you want to share some code in Slack, LinkedIn, or even in a post here.
It is super easy to use and super easy to customize.

Of course, you can write your code here and it looks good, right?

// taking kilometers input from the user
const kilometers = prompt("Enter value in kilometers: ")

// conversion factor
const factor = 0.621371

// calculate miles
const miles = kilometers * factor

console.log(`${kilometers} kilometers is equal to ${miles} miles.`);
Enter fullscreen mode Exit fullscreen mode

But c'mon, this looks clean

Code snippet from Carbon

That's all, I hope it can be helpful for you 🥳

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs