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
| #include "list.h" | |
| List list_instance(size_t type_size) { | |
| return (List){ | |
| .data = malloc(0), | |
| .size = 0, | |
| .type_size = type_size | |
| }; | |
| } |
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
| class AVLNode { | |
| public left: AVLNode|null = null; | |
| public right: AVLNode|null = null; | |
| public height: number = 1; | |
| constructor( | |
| public value: number | |
| ) {} | |
| } |
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
| #include "gmdutil.h" | |
| typedef struct Point { | |
| int x; | |
| int y; | |
| } Point; | |
| default(Point) { | |
| self->x = 0; | |
| self->y = 0; |
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
| /** | |
| * @summary The Result<Ok, Error> interface describes the result of a function that can occur in two different ways, being an error or a positive result. | |
| * @summary The methods in this interface help the developer to better understand the result of the function and then deal with it directly. | |
| * @summary Use ``Ok(value)`` or ``Err(error)`` to instantiate this. | |
| */ | |
| export interface Result<Ok = any, Err = Error> { | |
| isOk(): boolean, | |
| isErr(): boolean, | |
| /** | |
| * @throws "Tried to unwrap an error value but the value is ok." - When you try to unwrap an ok value as error. |
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
| #ifndef ANY_H | |
| #define ANY_H | |
| #include <stdbool.h> | |
| #include <stdint.h> | |
| enum Variant { | |
| V_ANY, | |
| V_STRING, | |
| V_CHAR, |
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
| export type MutexGuard<T> = Readonly<{ | |
| id: string, | |
| get: () => T, | |
| set: (value: T) => void, | |
| unlock: () => void | |
| }>; | |
| export type Mutex<T> = Readonly<{ | |
| lock(): Promise<MutexGuard<T>> | |
| }>; |
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
| const types: Readonly<{[K: string]: any}> = Object.freeze({ | |
| NaN: 'nan', | |
| String: 'string', | |
| Number: 'number', | |
| Boolean: 'boolean', | |
| Object: 'object', | |
| Undefined: 'undefined', | |
| Null: 'null', | |
| Function: 'function', | |
| Class: 'class', |
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
| @echo off | |
| title Configurando VSCode | |
| echo Adicionando C:\MinGW\bin ao PATH | |
| powershell -Command "function Add-Path($path) { $pathContent = [Environment]::GetEnvironmentVariable('path', 'user'); if ($pathContent -ne $null) { if (!($pathContent -split ';' -contains $path)) { $pathContent = $pathContent + [IO.Path]::PathSeparator + $path; [Environment]::SetEnvironmentVariable('Path', $pathContent, 'User'); } } } Add-Path('C:\MinGW\bin')" | |
| echo Instalando pacotes do VSCode | |
| cmd /c code --force --install-extension MS-CEINTL.vscode-language-pack-pt-BR --install-extension ms-vscode.cpptools --install-extension ms-vscode.cpptools-extension-pack --install-extension danielpinto8zz6.c-cpp-compile-run --install-extension danielpinto8zz6.c-cpp-project-generator | |
| echo Iniciando VSCode | |
| code --locale pt-BR | exit |
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
| #ifndef UNICODE_H | |
| #define UNICODE_H | |
| #include <locale.h> | |
| #include <wchar.h> | |
| #include <stdarg.h> | |
| #include <stdio.h> | |
| #include <wctype.h> | |
| #include <stdlib.h> |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| /* | |
| Essa é uma função que eu criei parecida com o scanf | |
| O intuito é ler um texto digitado pelo teclado com um tamanho máximo determinado | |
| Recebe como parâmetro: | |
| 1. uma mensagem pedindo para o usuário digitar | |
| 2. um limite máximo de caracteres |
NewerOlder