Instalando Docker em um WSL 2 com Ubuntu 22.04
Before start the installation process, make sure you meet the following prerequisites:
- A Windows 10 operating system with WSL 2 support.
- WSL 2 enabled.
- Ubuntu 22.04 installed on WSL 2.
| """ | |
| A micro event loop library implementation from scratch. | |
| This library provides a minimal but feature-complete asynchronous event loop | |
| implementation for educational purposes. It demonstrates the core concepts of | |
| asynchronous programming including: | |
| - Task scheduling and management | |
| - I/O multiplexing with non-blocking sockets | |
| - Timeouts and sleep functionality |
| # ActiveJob natively captures constructor arguments in an `@arguments` instance variable | |
| # which is also exposed as an `arguments` property on each job instance. | |
| # | |
| # Calls to `perform_now` and `perform_later` both forward arguments to the constructor. | |
| # | |
| # For example, all of these invocation styles work. | |
| # | |
| # result = DoStuffJob.new("foobar").perform # sync | |
| # result = DoStuffJob.new.perform("foobar") # sync | |
| # result = DoStuffJob.perform_now("foobar") # sync |
| # This is a thin wrapper of the Simple Form builder. It delegates rendering the resulting form fields to Simple Form | |
| # but typically amends the Tailwind classes of the various elements in the field layout. It tightly integrates with the | |
| # unstyled wrapper (aka `:plain`) Simple Form configuration (see `simple_form.rb`). The methods support the same syntax | |
| # as the original Simple Form methods but enhance it to support replacing defaylt Tailwind claseses. | |
| class Builders::TailwindFormBuilder < SimpleForm::FormBuilder | |
| # This is the basic method for rendering `<input>` tags and their variants. | |
| def input(attribute_name, options = {}, &block) | |
| # The default Tailwind classes for the various parts of the Simple Form wrapper layout. | |
| input_class = "block w-full sm:text-sm ... #{'text-gray-500 bg-gray-50' if options.dig(:input_html, :disabled)}" |
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
| FROM ruby:3.0-alpine | |
| RUN apk add --no-cache --update \ | |
| ack \ | |
| bash \ | |
| build-base \ | |
| curl \ | |
| git \ | |
| htop \ | |
| less \ |
| # app/models/board.rb | |
| class Board < ApplicationRecord | |
| has_many :embeds | |
| end |
| import os | |
| from typing import List | |
| import pymysql.cursors | |
| def db_connection(f): | |
| """ | |
| Supply the decorated function with a database connection. |
| const poll = ({ fn, validate, interval, maxAttempts }) => { | |
| console.log('Start poll...'); | |
| let attempts = 0; | |
| const executePoll = async (resolve, reject) => { | |
| console.log('- poll'); | |
| const result = await fn(); | |
| attempts++; | |
| if (validate(result)) { |