teleren/devto huggingface dataset:
Deploying a project to fly.io with GitHub Actions
Tags: workflow, devops, todayilearned
Published: 2023-06-13 11:19:45

---
title: Deploying a project to fly.io with GitHub Actions
published: true
description: Setting up continuous deployment with a fly.io hosted project
tags: workflow, devops, til
series: bee
# cover_image: https://direct_url_to_image.jpg
---

I have a citizen science mobile app project, which is hosted on fly.io. Here's how I used GitHub actions on my project repo to automatically deploy my code updates.

- check out the Fly docs for [continuous deployment with GitHub actions](https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/)

-----

## Generate your deploy token

Use the command line to generate a deploy token (Keep it secret!), required to push to your application, `flyctl tokens create deploy`. You can use the fly dashboard Tokens if you prefer GUI.

[Deploy tokens are experimental](https://fly.io/docs/reference/deploy-tokens/), but unlike auth tokens they will manage a single application and its resources, as opposed to accessing _all_ your apps. 

> "These kinds of tokens are an entirely new concept! We're still working out the kinks. We'll do our best, but we may have reset these tokens periodically while we get things right." _-fly.io_

You'll need to set the token as the `FLY_API_TOKEN` environment variable:
```bash
FLY_API_TOKEN=$(flyctl tokens create deploy) flyctl deploy
```

## Add the token to your repo

Your deploy token needs to be added as a Secret in your GitHub repo, so you can use it in your configuration without making the token public.

Go to **Settings**, **Secrets and variables**, **Actions**, and create a repository secret called `FLY_API_TOKEN` with your token value:

Name: `FLY_API_TOKEN`
Value: _enter the auth token generated at the command line_

## Configure your workflow

My project has workflow actions set up for running tests and build, so I already have a `.github` directory in my project, with the `workflows` sub-directory inside:

![.github folder](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npv6nydjjtblubu0uyi0.png)

Replicate that set up in your project and add a new directory for you deployment workflow, I'll call mine `deploy.yml`. This is a YAML file which is used for our configuration.

The docs have an [example template](https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/#:~:text=create%20.github/workflows/fly.yml%20with%20these%20contents%3A) which you can customise for your project, remember to use the correct branch name.

## Publish your workflow

When you commit and push your config YAML file to GitHub, it will automatically create the workflow in Actions.

Go to **Actions** and you should see your new "Fly Deploy" workflow, along with any workflow runs you have.

![GitHub Actions screen](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lyjyl2kaia72jth4bfmb.png)

Verify this works in Fly, by going to your app dashboard, and checking the latest action is deployed with your last commit.
Every push to your configured branch will now be deployed to your fly application.
Send data to third party in Asp.net core
Tags: webdev, programming, aspdotnet, javascript
Published: 2023-06-13 11:17:02

In ASP.NET Core, you can send data to a third-party service or API using various methods, such as making HTTP requests. Here's an example of how you can send data to a third party using the HttpClient class:

1. Install the `System.Net.Http` package if it's not already installed in your ASP.NET Core project.

2. In your controller or service class, inject an instance of `HttpClient` using the dependency injection system. For example, in a controller:

```csharp
private readonly HttpClient _httpClient;

public YourController(HttpClient httpClient)
{
    _httpClient = httpClient;
}
```

3. Use the `PostAsync` method of the `HttpClient` to send data to the third party. Here's an example:

```csharp
public async Task<IActionResult> YourAction()
{
    // Create a data object to send
    var data = new { Name = "John", Age = 25 };

    // Serialize the data object to JSON
    var json = JsonConvert.SerializeObject(data);

    // Create a StringContent with the JSON data
    var content = new StringContent(json, Encoding.UTF8, "application/json");

    // Send the POST request to the third party API
    var response = await _httpClient.PostAsync("https://api.example.com/endpoint", content);

    // Check if the request was successful
    if (response.IsSuccessStatusCode)
    {
        // Process the response from the third party API
        // ...
        return Ok();
    }
    else
    {
        // Handle the error
        // ...
        return StatusCode((int)response.StatusCode);
    }
}
```

In this example, we create an anonymous object representing the data we want to send. We then serialize the object to JSON using the Newtonsoft.Json library (`JsonConvert.SerializeObject`). Next, we create a `StringContent` object with the JSON data and specify the content type as "application/json". Finally, we make a POST request to the specified URL using `PostAsync`, passing the content object.

Make sure to replace `"https://api.example.com/endpoint"` with the actual URL of the third-party API you want to send data to. Also, handle any exceptions that may occur during the HTTP request for proper error handling.

Remember to configure the `HttpClient` instance in your ASP.NET Core project's `Startup.cs` file, specifying the base address and any additional configuration needed, such as authentication or custom headers.

Note: This example uses Newtonsoft.Json for JSON serialization. If you're using .NET Core 3.0 or later, you can use the built-in `System.Text.Json` namespace for JSON serialization instead.
Splunk send data to third party in Asp.net core
Tags: webdev, programming, aspdotnet, javascript
Published: 2023-06-13 11:15:13

To send data from an ASP.NET Core application to a third-party system, such as Splunk, you can use the HTTP client capabilities provided by the framework. Here's a general outline of the steps involved:

1. Add the `System.Net.Http` namespace to your class file to access the `HttpClient` class.

2. Create an instance of `HttpClient` to make HTTP requests to the third-party system. You can do this by injecting `IHttpClientFactory` into your class and using it to create the client, or by instantiating `HttpClient` directly.

```csharp
private readonly HttpClient _httpClient;

public YourClassName(HttpClient httpClient)
{
    _httpClient = httpClient;
}
```

3. Configure the base URL and any necessary headers for your request. Check the documentation provided by Splunk to determine the required headers or authentication methods.

```csharp
var baseUrl = "https://api.splunk.com/your-endpoint";
_httpClient.BaseAddress = new Uri(baseUrl);

// Set any required headers
_httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer yourAccessToken");
_httpClient.DefaultRequestHeaders.Add("Content-Type", "application/json");
```

4. Prepare your data to be sent. You can serialize your data to JSON format using a library like `Newtonsoft.Json`.

```csharp
var data = new { key1 = "value1", key2 = "value2" };
var jsonData = JsonConvert.SerializeObject(data);
```

5. Create an `HttpContent` object with your serialized JSON data.

```csharp
var content = new StringContent(jsonData, Encoding.UTF8, "application/json");
```

6. Send the HTTP POST request to the third-party system.

```csharp
var response = await _httpClient.PostAsync("", content);
```

7. Process the response as needed. You can check the response status code and handle any errors or success cases accordingly.

```csharp
if (response.IsSuccessStatusCode)
{
    // Success
}
else
{
    // Handle errors
}
```

Remember to handle exceptions and dispose of the `HttpClient` properly to prevent resource leaks. You may also need to configure additional settings, such as timeouts or SSL/TLS options, depending on the requirements of the third-party system.

Please note that the specific implementation details and endpoints may vary depending on the Splunk API you are using. Be sure to consult the Splunk documentation or API reference for the correct endpoint, authentication, and data format requirements.
Como criar um site progressivo com o uso de PWA (Progressive Web Apps)
Tags: pwa, webdev
Published: 2023-06-13 11:12:59

As Progressive Web Apps (PWAs) são um conjunto de técnicas para criar sites que se comportam como aplicativos nativos, oferecendo uma experiência de usuário imersiva, responsiva e com alta performance. Neste artigo, vamos discutir como criar um site progressivo com o uso de PWA.

## O que é uma PWA?

Uma Progressive Web App é um site que usa tecnologias modernas para oferecer uma experiência de usuário semelhante a um aplicativo nativo. As PWAs são construídas com base em três pilares principais: segurança, desempenho e acessibilidade. Além disso, as PWAs também oferecem recursos avançados, como notificações push, armazenamento offline e integração com o sistema operacional.

## Como criar uma PWA?

Para criar uma PWA, você precisa seguir alguns passos:

### Passo 1: Tornar o site responsivo

Para que o site seja responsivo e funcione em diferentes dispositivos, é importante usar técnicas de design responsivo, como usar media queries e layouts flexíveis.

### Passo 2: Tornar o site seguro

Para tornar o site seguro, é necessário usar HTTPS para proteger a comunicação entre o servidor e o cliente. Isso ajuda a evitar ataques de hackers e protege a privacidade do usuário.

### Passo 3: Adicionar um manifesto

O manifesto da PWA é um arquivo JSON que define as configurações da PWA, como o nome, ícone, cor de fundo, tela inicial e outros recursos. O manifesto deve ser adicionado ao cabeçalho do site.

### Passo 4: Adicionar um Service Worker

O Service Worker é um script JavaScript que roda em segundo plano e gerencia o cache do site. Ele permite que o site funcione offline e oferece um desempenho melhorado, armazenando os recursos em cache.

### Passo 5: Adicionar recursos avançados

Além dos recursos básicos, as PWAs também oferecem recursos avançados, como notificações push, armazenamento offline e integração com o sistema operacional. Esses recursos podem ser adicionados usando APIs da Web modernas.

## Conclusão

As Progressive Web Apps são uma ótima maneira de oferecer uma experiência de usuário imersiva, responsiva e com alta performance. Para criar uma PWA, é necessário tornar o site responsivo, seguro e adicionar um manifesto e um Service Worker. Além disso, você também pode adicionar recursos avançados, como notificações push, armazenamento offline e integração com o sistema operacional. Ao seguir essas etapas, você pode criar um site progressivo e oferecer uma experiência de usuário de alta qualidade para seus usuários.
As melhores práticas para desenvolver interfaces acessíveis
Tags: webdev
Published: 2023-06-13 11:12:35


A acessibilidade é um aspecto fundamental do design de interfaces, mas muitas vezes é negligenciada. Interfaces acessíveis não são apenas importantes para pessoas com deficiência, mas também para melhorar a experiência do usuário em geral. Neste artigo, vamos discutir algumas das melhores práticas para desenvolver interfaces acessíveis.

## Use tags apropriadas

As tags apropriadas ajudam os usuários a entender o conteúdo e a navegar em sua interface. Ao desenvolver sua interface, certifique-se de usar tags apropriadas, como `<h1>`, `<h2>`, `<p>`, etc. Isso ajudará os usuários a entender a estrutura da página e a encontrar o conteúdo relevante com mais facilidade.

## Adicione descrições alternativas a imagens

Para usuários que utilizam leitores de tela, é importante adicionar descrições alternativas a imagens. Essas descrições explicam o conteúdo da imagem e ajudam a fornecer uma experiência mais completa para o usuário. Certifique-se de usar descrições claras e concisas, que descrevam o conteúdo da imagem de forma adequada.

## Use cores com contraste suficiente

Para usuários com deficiência visual, é importante usar cores com contraste suficiente. Certifique-se de que o texto e os elementos da interface possuam contraste suficiente para serem facilmente legíveis. Existem várias ferramentas disponíveis para testar o contraste de cores em sua interface, como o Contrast Checker do WebAIM.

## Use teclado para navegação

Para usuários que não conseguem usar o mouse, é importante usar o teclado para navegação. Certifique-se de que todos os elementos da interface possuam foco de teclado e possam ser navegados com as teclas TAB e SHIFT+TAB. Além disso, certifique-se de que todas as interações possam ser realizadas usando apenas o teclado.

## Verifique a ordem de leitura

Para usuários que utilizam leitores de tela, é importante verificar a ordem de leitura da página. Certifique-se de que a ordem de leitura esteja correta, seguindo a ordem visual da página. Isso ajudará os usuários a entenderem melhor o conteúdo da página e a navegar com mais facilidade.

## Conclusão

Desenvolver interfaces acessíveis é importante para fornecer uma experiência positiva para todos os usuários. Usar tags apropriadas, adicionar descrições alternativas a imagens, usar cores com contraste suficiente, usar o teclado para navegação e verificar a ordem de leitura são algumas das melhores práticas para desenvolver interfaces acessíveis. Ao seguir essas práticas, você pode criar interfaces mais inclusivas e acessíveis para todos os usuários.
Tudo o que você precisa saber sobre Flexbox e Grid Layout
Tags: webdev, css, development
Published: 2023-06-13 11:12:17

Se você é um desenvolvedor front-end, provavelmente já ouviu falar de Flexbox e Grid Layout. Ambas são técnicas de layout CSS poderosas que podem ajudá-lo a criar layouts flexíveis e responsivos em seus projetos. Neste artigo, vamos discutir tudo o que você precisa saber sobre Flexbox e Grid Layout.

## O que é Flexbox?

Flexbox é uma técnica de layout CSS que permite criar layouts flexíveis e responsivos. Com Flexbox, você pode criar layouts baseados em um sistema de caixas flexíveis que podem ser facilmente organizadas em uma única linha ou coluna, ou em várias linhas e colunas. Flexbox é especialmente útil para criar layouts para dispositivos móveis e telas pequenas.

## O que é Grid Layout?

Grid Layout é outra técnica de layout CSS que permite criar layouts flexíveis e responsivos. Com Grid Layout, você pode criar layouts baseados em uma grade de linhas e colunas. Isso permite que você organize facilmente o conteúdo em um layout complexo, com controle preciso sobre a posição e o tamanho dos elementos.

## Flexbox vs Grid Layout

Flexbox e Grid Layout têm algumas diferenças importantes. Flexbox é mais adequado para layouts baseados em uma única linha ou coluna, enquanto Grid Layout é mais adequado para layouts baseados em uma grade de linhas e colunas. Além disso, Flexbox é mais adequado para layouts simples, enquanto Grid Layout é mais adequado para layouts complexos.

## Como Usar Flexbox e Grid Layout

Para usar Flexbox e Grid Layout em seus projetos, você precisa entender as propriedades CSS que controlam essas técnicas. Algumas das propriedades mais importantes incluem:

### Propriedades do Flexbox

-   `display: flex`: define o elemento como um contêiner flexível.
    
-   `flex-direction`: define a direção principal dos itens flexíveis.
    
-   `justify-content`: define a posição dos itens flexíveis ao longo do eixo principal.
    
-   `align-items`: define a posição dos itens flexíveis ao longo do eixo secundário.
    

### Propriedades do Grid Layout

-   `display: grid`: define o elemento como um contêiner de grade.
    
-   `grid-template-rows` e `grid-template-columns`: definem o número e o tamanho das linhas e colunas da grade.
    
-   `grid-row-start` e `grid-row-end`, `grid-column-start` e `grid-column-end`: definem a posição e o tamanho dos elementos na grade.
    

## Conclusão

Flexbox e Grid Layout são técnicas poderosas de layout CSS que podem ajudá-lo a criar layouts flexíveis e responsivos em seus projetos. Ao entender as diferenças entre essas duas técnicas e as propriedades CSS associadas a cada uma delas, você pode criar facilmente layouts complexos e responsivos para seus projetos front-end.
How to buy instant facebook likes in India
Tags: facebook
Published: 2023-06-13 10:13:26


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5watfvio4ikh51wux4ti.jpg)

Facebook (FB) is viewed as the "**[buy facebook likes](https://www.indidigital.in/product/buy-facebook-likes-india-fb-usa-uk/)**" for clear reasons. Aside from being quite possibly of the most established network, it is the most utilized around the world. Research shows that grown-ups spend no less than seven hours of their week on the stage, and the typical client surfs the application something like twenty minutes everyday. This is to show the degree to which FB is an amazing asset for any individual who needs to contact a wide crowd.

To acquire perceivability, either as an individual, corporate association, or business, Facebook is the ideal spot for you. Be that as it may, while numerous clients open FB accounts meaning to help brand perceivability, making deals, and arriving at their main interest group, they hang tight for a very long time without accomplishing the point. buy facebook likes, however their records experience no development at all. It happens in light of the fact that many individuals falling into this class have neglected to take advantage of the persuasive 'Like' highlight that FB offers, arriving at the important number of likes. For this situation, the likelihood to buy Facebook likes is ideal choice to save time, cash and exertion.

Like' is a way individuals draw in with posts on **[buy facebook likes](https://www.indidigital.in/product/buy-facebook-likes-india-fb-usa-uk/)**, appearing, in a real sense, that you appreciate or recognize a distribution. On FB, you can show your positive response through the 'thumbs up' button. Like each and every other stage, Facebook has pointers to mirror the rate at which individuals are drawing in and associating with your substance. This goes quite far to portray the level of your web-based presence.

Individuals will generally pass judgment on you in light of the quantity of 'thumbs up' you get on your post. This implies that the more likes your post get, the more verification you have that you truly deserve relating, drawing in with, partner with, buy facebook likes, this is a strong component that impacts your situation on Facebook. Obtaining numerous top picks depicts you as a compelling individual, and individuals like to connect with power.

Producing social signs is definitely not a simple assignment. Nonetheless, buy facebook likes is a more agreeable and quicker method for arriving at your ideal objectives. Here are the extraordinary advantages you will get when you buy genuine Facebook likes:

**[buy facebook likes](https://www.indidigital.in/product/buy-facebook-likes-india-fb-usa-uk/)**

To get in touch with INDIDIGITAL TEAM, contact at India contact #- +91-9971778006, USA Contact #- 1–8068484144, email us- contact@indidigital.com, skype us- indidigital, indidigital@gmail.com For more visit our website: https://www.indidigital.in/
120 Days Of Dev0ps
Published: 2023-06-13 10:50:30

Here we go...
I'm starting 120 days of learning DevOps and i will be updating it here for we all to see and you can as well join me
oh pardon my manners; I almost forgot to introduce myself. 
My Name is KENNETH AIGBUZA; i currently work as an Industrial kitchen and Laundry Equipment Technician. Are you surprise that a Technician wants to embark on a journey of learning DevOps? com"on ride with me as i update you all on my progress as we go

stay tuned!!!!

#DevOps #Learning #Cloud
Microsoft MD-100v6 Certification Guide: Everything You Need to Know
Published: 2023-06-13 10:39:36

**MD-100 Exam Dumps** (20-25%) enforce and manipulate deliver Chain methods (25-30%) up-to-date Warehouse control and Transportation management and carry out commercial enterprise tactics (25-30%) Microsoft MD-100 Certification examination necessities are as follow applicants for this exam have a simple understanding of the principles of company accounting and finance, up-to-date, on line service, manufacturing, [Microsoft MD-100 Exam Dumps](https://dumpsboss.com/microsoft-exam/md-100/) retail, and deliver chain control ideas. candidates for this examination are generally skilled in one or more Microsoft Dynamics 365 feature units, along with finance, production, and supply chain control. 

**MD-100 Dumps** candidates must have some information of deliver chain control practices, along with procurement, exchange, logistics, warehouse management, and transportation control. Registration system of the Microsoft MD-100 Certification exam are as comply with those are following steps for registering the Microsoft MD-100 exam. Step 1: up to dateupdated up to date Microsoft examination Registration Step 2: Signup/Login updated MICROSOFT account Step three: search for Microsoft MD-100 Certifications examination Step four: 

Get Upto 90% Off >>>>>> https://dumpsboss.com/microsoft-exam/md-100/
Pytest & unit test in python
Tags: python, testing, pytest
Published: 2023-06-13 10:39:14

Session 11: Testing with PyTest
useful links:
[Testing Demo](https://code-maven.com/slides/python/testing-demo)
[Testing with Pytest](https://code-maven.com/slides/python/pytest)
what we learned:
testing with pytest
test methods
testing demo tools in Python
AUT-application under test
Regression test
doctest
unit test
pytest
pytest run doctest
test coverage
pytest setup
examples test
expected exception
change text
pytest missing exception
exception raised
exercise-test exceptions
multiple failures
selective running of test functions
stop on the first failure
examples:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3l0i9o04jnkuxmkugy7k.JPG)
_**import unittest
Now to make our class declaration:
class TestingClass(unittest.TestCase):

Inside the class add our first function:
def test_first(self):
    test_var = 9 + 1
    self.assertEqual(11,test_var)**_
self.assertEqual is a method given by the previously inherited class (unittest.TestCase). This method tests if the 2 variables are equally of the same value.

Adding our test runner. This is what makes our unit test run:
unittest.main()
This is what the completed code should look like:

The above code demonstrates testing if 9 + 1 is equal to 11. If you know any basic math you should know that 9+1 = 10. Hence this test case would fail.

_Output:

As you should have already guessed. Failure!

The fix is simple. Modify the code to:
test_var = 9 + 2
Output:

Testing Outside Functions
For testing outside of functions, the previous example might not be realistic. Let’s replace the test_var values to now come from a function. We will add a functional declaration to the top of our file.
def add(a,b):
    return a + b
This function adds 2 numbers together. Replace 9 + 2 with the function call add(9,2) and then run your code.
Responsive Web Design in Affordable Price
Published: 2023-06-13 10:34:54

Anaxdesigns offers [responsive web design company](https://www.anaxdesigns.com/), dedicated to creating unique and tailored websites for all small businesses. Our team of experienced website designers works carefully with clients to understand their specific needs and goals. From captivating visuals to seamless user experiences, we combine creativity and technical expertise. We create visually stunning and highly functional websites that make a lasting impression. Reach us to bring your vision to life and get custom [web design solutions](https://www.anaxdesigns.com/) that reflect your brand and drive measurable results