Skip to content

Instantly share code, notes, and snippets.

View Haple's full-sized avatar
📖
S T U D Y I N G

Aleph Santos Oliveira Haple

📖
S T U D Y I N G
View GitHub Profile
@Haple
Haple / canPlantFlowers.js
Created July 15, 2024 16:47
Interview question of the week
function canPlantFlowers(flowerbed, k) {
let count = 0;
let n = flowerbed.length;
for (let i = 0; i < n; i++) {
if (flowerbed[i] === 0) {
let emptyLeft = (i === 0) || (flowerbed[i - 1] === 0);
let emptyRight = (i === n - 1) || (flowerbed[i + 1] === 0);
if (emptyLeft && emptyRight) {
@Haple
Haple / docker-compose.yml
Created November 11, 2020 22:39 — forked from hannes-thaller/docker-compose.yml
MongoDB Charts (docker-compose)
version: "3.3"
services:
mongo:
image: mongo:4.1.1
restart: on-failure
command: --wiredTigerCacheSizeGB 3
ports:
# Charts db is available under port 27018 to not block the default mongo port
- "8082:8081"
@Haple
Haple / dev_challenge.md
Created August 20, 2020 00:30 — forked from lucas-brito/dev_challenge.md
ClassApp Dev Challenge

Dev Challenge

Create a program in Node.js where the input defined in input.csv is parsed and organized into the content shown in output.json.

Please write your program in only one file (like index.js) and write the output to a file (output.json) instead of printing it to logs or on the screen.

Future<List<Abono>> _buscaAbonos() async {
final url = "https://bate-ponto-backend.herokuapp.com/abonos";
Map<String, String> headers = {
'Authorization': await getToken(),
};
final response = await http.get(url, headers: headers);
if (response.statusCode == 200) {
return abonosFromJson(response.body);