Skip to content

Instantly share code, notes, and snippets.

View virgs's full-sized avatar
🦩

Guilherme Moraes virgs

🦩
View GitHub Profile
@virgs
virgs / us-visa-scheduler.js
Last active May 24, 2024 04:30
US appointment slot scheduler
const audioSource = 'https://cdn.freesound.org/previews/533/533869_5828667-lq.mp3'
const cityCode = 56; // São Paulo
const formattedMaxDate = '2023-11-30'; // YYYY-MM-DD
const maxNumberOfCandidateDates = 4; //avoid throttling
const language = 'pt-br';
const sessionNumber = 38681568;
const minIntervalBetweenFetchesInMinutes = 2;
const randomizedIntervalBetweenFetchesInMinutes = 2;
const secondsBetweenDateTimeFetchCalls = 10;
@virgs
virgs / variable-address.cpp
Last active November 3, 2021 01:35
Endereços de variáveis
using namespace std;
int main()
{
int a = 10;
int& b = a; // criação do apelido "b" para a variável "a";
cout << "a: " << a << "; b: " << b << "\n"; // a: 10; b: 10
b = 20;
cout << "a: " << a << "; b: " << b << "\n"; // a: 20; b: 20
a = 30;
export class MainScene extends Phaser.Scene {
//...
public async create(): Promise<void> {
EventManager.emit(Events.GAME_BEGAN);
new BoardHandler({scene: this});
new AliveBlockHandler({scene: this});
new InputManager({scene: this});
EventManager.emit(Events.BOARD_CREATE_NEW_BLOCK);
}
@virgs
virgs / mocked-class.ts
Last active January 20, 2023 19:25
How to mock static methods and non static methods using Jest
export class MockedClass {
public instanceMethod(): string {
return "instance";
}
public static staticMethod(): string {
return "static";
}
}