Skip to content

Instantly share code, notes, and snippets.

View zignd's full-sized avatar
:shipit:
Writing…

Igor Hipólito Vieira zignd

:shipit:
Writing…
View GitHub Profile
#!/usr/bin/env python3
# ASDPC
# Prof. Luiz Lima Jr.
from pika import BlockingConnection
from sys import argv
from enum import Enum
E = Enum("Estado", "INICIADOR OCIOSO ATIVO OK")
@zignd
zignd / fix.md
Last active August 28, 2022 17:19
Kubuntu + KDE + ZSH + Missing Snap .desktop shortcuts in laucher

As soon as you set ZSH as your default shell in Kubuntu/KDE, remember to set this configuration in your /etc/zsh/zprofile:

emulate sh -c 'source /etc/profile'
@zignd
zignd / unreal_print_message_screen.cpp
Created August 8, 2022 00:59
Unreal - Print Message on Screen
if (GEngine)
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Yellow, FString::Printf(TEXT("Y: %.2f"), 2345.12f));
version: '2.1'
services:
php:
tty: true
build:
context: .
dockerfile: tests/Docker/Dockerfile-PHP
args:
version: cli
volumes:
@zignd
zignd / merge-sort-generics.go
Created January 23, 2022 20:21
Merge Sort in Go using Generics
package main
import (
"constraints"
"fmt"
)
func main() {
input := []int{9, 5, 7, 3, 4, 1, 0, 2}
@zignd
zignd / clean-up-disk-space-docker.sh
Last active January 10, 2022 12:31
Commands to clean up disk space used by Docker
docker rm -f $(docker ps -qa) # remove all containers, running or not, because it affects the next commands
docker volume prune -f
docker image prune --all
@zignd
zignd / wait-group.js
Created September 4, 2021 07:07
Golang-like WaitGroup implementation for Node.js
const EventEmitter = require('events')
class WaitGroup {
constructor() {
this.addedCount = 0
this.currentCount = 0
this.emitter = new EventEmitter()
}
add(delta = 1) {
@zignd
zignd / docker-compose.yml
Created September 2, 2021 11:04 — forked from rmoff/docker-compose.yml
Docker-Compose for Kafka and Zookeeper with internal and external listeners
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
const fs = require("fs")
const path = require("path")
function example(message, callback) {
const filePath = path.join(process.cwd(), "callback-file-test")
const data = Buffer.from(message)
fs.access(filePath, fs.constants.F_OK, (err) => {
if (!err) {
return callback(new Error("can't proceed, the file exists"))
async function openDatabaseConnection() {
const connection = {
isOpen: true,
hasPermissionToDelete: false
}
return connection;
}
async function example() {
const connection = await openDatabaseConnection();