This file contains 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
// Exemplo de variáveis | |
let a = 10; | |
let b: u32 = 20; | |
let c = a + b; |
This file contains 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
var minhaLista = new List<Food> { | |
new Food { Type = "Mineira"}, | |
new Food { Type = "Italiana"}, | |
new Food { Type = "Japonesa"} | |
}; | |
for (int i = 0; i <= minhaLista.Count; i++) | |
{ | |
var item = minhaLista[i]; | |
Console.WriteLine(item.Type); |
This file contains 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
// Lista de strings | |
var minhaLista = new List<string> { "arroz", "feijão", "banana" }; | |
// Quero iterar sobre esta lista | |
// Utilizando for, precisamos de um contador (No caso i) | |
// Sabendo que os arrays no C# começam do ZERO... | |
// Então é uma boa prática começar i como zero | |
// Contamos até que i seja menor que 3 (Total de itens da lista) | |
for (int i = 0; i < 3; i++) |
This file contains 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
{ | |
"final_space": true, | |
"console_title": true, | |
"console_title_style": "folder", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"horizontal_offset": 0, | |
"vertical_offset": 0, |
This file contains 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
var orders = new List<Order> | |
{ | |
new("Order 1 -10 itens", GenerateOrderLines(9)), | |
new("Order 2 +10 itens ", GenerateOrderLines(12)), | |
new("Order 3 +10 itens", GenerateOrderLines(18)), | |
new("Order 4 +10 itens", GenerateOrderLines(22)) | |
}; | |
List<OrderLine> GenerateOrderLines(int quantity) | |
{ |
This file contains 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
builder.Services.AddControllers() | |
.ConfigureApiBehaviorOptions(options => | |
{ | |
options.SuppressModelStateInvalidFilter = true; | |
}); |
This file contains 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
public static class DateTimeExtension | |
{ | |
public static bool IsWeekend(this DateTime date) => date.DayOfWeek is DayOfWeek.Saturday or DayOfWeek.Sunday; | |
public static bool IsHoliday(this DateTime date, IEnumerable<DateTime> holidays) => holidays.Any(x => x == date); | |
public static DateTime Normalize(this DateTime date, IEnumerable<DateTime> holidays) | |
{ | |
while (date.IsHoliday(holidays) || date.IsWeekend()) | |
{ |
This file contains 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
using System; | |
using System.Security.Cryptography; | |
using System.Text; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
namespace MyBenchmarks | |
{ | |
public class StringBuilderVsArray | |
{ |
This file contains 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
app.UseEndpoints(endpoints => | |
{ | |
endpoints.MapGet("/", async context => | |
{ | |
using var playwright = await Playwright.CreateAsync(); | |
await using var browser = await playwright.Chromium.LaunchAsync(); | |
var page = await browser.NewPageAsync(new ViewportSize {Width = 1200, Height = 600}); | |
await page.GoToAsync("https://balta.io"); | |
var file = await page.ScreenshotAsync(); |
This file contains 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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
// This widget is the root of your application. | |
@override | |
Widget build(BuildContext context) { |
NewerOlder