This document outlines best practices and examples for building FastAPI applications that offload work to Celery tasks, including chaining tasks and handling asynchronous HTTP requests.
Create a Django application that integrates with a public API, retrieves data, and stores it in a PostgreSQL database. The application should expose endpoints to fetch the stored data and perform basic CRUD operations.
- Use a public API (e.g., OpenWeatherMap API) to fetch weather data for a given city.
- Store the fetched data in a PostgreSQL database.
Celery is a distributed task queue that handles real-time processing with a focus on operations requiring immediate execution.
- Maturity: Celery has been around for a long time and is a well-established tool with a large community. It is used in many production environments, which attests to its reliability and robustness.
- Flexibility: It supports multiple message brokers like RabbitMQ, Redis, and Amazon SQS, providing flexibility in choosing the right tool for message passing.
- Scalability: It can scale out to handle a large number of tasks very efficiently across multiple workers and servers.
- Performance: Optimized for high-throughput and real-time task processing, making it ideal for applications that require immediate task processing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "appmap-example", | |
"appmap_dir": "tmp/appmap", | |
"packages": [ | |
{ | |
"name": "app", | |
"path": "app", | |
"handler_class": "AppMap::Handler::FunctionHandler", | |
"shallow": false | |
}, |
I am applying for a job at the company named [redacted]. I am writing a cover letter that should include 3–4 paragraphs explaining why I'm the perfect candidate for a specific job.
Here is the job description:
- Developing front-end website architecture using hotwire and tailwind.
- Designing user interactions on web pages.
- Developing back-end website applications.
- Ensuring cross-platform optimization for mobile phones.
- Ensuring responsiveness of applications.
- Working alongside graphic designers for web design features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"angle_down": { | |
"solid": [ | |
{ | |
"stroke": "currentColor", | |
"stroke_linecap": "round", | |
"stroke_linejoin": "round", | |
"stroke_width": "2", | |
"d": "m19 9-7 7-7-7" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
file_list = `gh pr diff $(git rev-parse --abbrev-ref HEAD) --name-only` | |
pr_files = file_list.split("\n") | |
puts "Running standardrb --fix on:" | |
pr_files.each { |f| puts " - #{f}" } | |
puts # empty line | |
system("bundle exec standardrb --fix #{pr_files.join(' ')}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Count lines of code in a pull request | |
# Usage: | |
# ./b/cloc_pr 22621 | |
# | |
# Code: +1212 / -208 | |
# Blank Lines: +241 / -18 | |
# Files: +17 / -0 | |
# Modified Files: 38 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# freeze_string_literal: true | |
module CreateWithCallbacks | |
extend ActiveSupport::Concern | |
# Mimic the FactoryBot `create` method but with callbacks. All traits and overrides are applied. | |
# | |
# @example with traits and attributes | |
# source_course = create_with_callbacks!( | |
# :course, |
NewerOlder