Skip to content

Instantly share code, notes, and snippets.

View jv-amorim's full-sized avatar
🙂
It's all good, man.

João Vitor Amorim jv-amorim

🙂
It's all good, man.
View GitHub Profile
@jv-amorim
jv-amorim / test-utils.ts
Created April 9, 2022 19:59
Utility class for testing Angular components.
import { DebugElement } from '@angular/core';
import { ComponentFixture } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
export class TestUtils {
public static findElementByTestId<T>(fixture: ComponentFixture<T>, testId: string): DebugElement {
return fixture.debugElement.query(By.css(`[data-testid="${testId}"]`));
}
@jv-amorim
jv-amorim / scroll-mouse-over.html
Created September 23, 2021 22:20
Scrolling With Mouse Over Event
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scrolling With Mouse Over Event</title>
<style>
body {
background-color: darkslategray;
}
@jv-amorim
jv-amorim / javascript-async.js
Last active September 23, 2021 22:21
Async (JavaScript)
let gitHubApi = 'https://api.github.com/users/JV-Amorim/repos';
// A) Usando a biblioteca Request (ultrapassada):
/*
const request = require('request');
request(gitHubApi, { headers: { 'User-Agent': 'node.js' } }, (err, res, body) => {
console.log(JSON.parse(body));
});
@jv-amorim
jv-amorim / SQLiteExamples.cs
Created April 27, 2020 01:36
Examples of using SQLite-net.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using SQLite;
public class SQLiteExamples : MonoBehaviour
{
private void Start()
{
var databasePath = Application.dataPath + "/SoftwareDatabase.db";
@jv-amorim
jv-amorim / SQLite in Unity.md
Last active October 3, 2021 00:48
SQLite files to use in Unity.
//
// Copyright (c) 2009-2019 Krueger Systems, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@jv-amorim
jv-amorim / C# SOLID Notes.md
Last active September 14, 2022 11:26
Notes about SOLID principles in C#.

📌️ C# SOLID Notes

Content:

  • SOLID;
  • Single Responsibility Principle (SRP);
  • Open/Closed Principle (OCP);
  • Liskov Substitution Principle (LSP);
@jv-amorim
jv-amorim / C# Interfaces Notes.md
Created April 26, 2020 20:45
Notes about Interfaces in C#.

📌️ C# Interfaces Notes

Content:

  • Interfaces;
  • Repository Pattern;
  • Repository Factory Pattern;
  • Dynamic Factory (instead of Compile-Time Factory);
@jv-amorim
jv-amorim / C# OOP Notes.md
Last active April 26, 2020 20:32
Notes about Orient-Object Programming in C#.

📌️ C# OOP Notes

Content

  • OOP;
  • Fields x Properties x Attributes;
  • Four Pillars of OOP;
  • Constructor Chaining;
@jv-amorim
jv-amorim / C# Collections Notes.md
Last active April 26, 2020 16:51
Notes about C# Collections.

📌️ C# Collections Notes

📄️ Lists:

✅️ The FindIndex() method can receive a lambda function as an argument and, thus, it's possible find the first unknown element that meets a desired requirement, present in the lambda function. Example: int brazilIndex = countries.FindIndex(x => x.Population < 220_000_000);

✅️ The Insert() method allows the insertion of an element after a desired index in the list. Example: