- The next big thing
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
#!/usr/bin/env python3 | |
""" | |
This script is used to send the contents of a specified file to a Kafka topic. | |
Pre-requisites: | |
- Python 3.x | |
- Kafka broker running and accessible | |
- Required Python packages installed (e.g., kafka-python, json, logging) | |
The file is expected to contain JSON data, which will be read, processed, and sent as a message to the Kafka topic. |
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
from copy import deepcopy | |
from logging.config import dictConfig | |
from os.path import isfile | |
import yaml | |
class LoggerDictConfigFormatter: | |
unwanted_keys: tuple = ('level', 'handlers', 'propagate') | |
max_deep: int = 10 |
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
import argparse | |
import os | |
from os.path import splitext | |
from PIL import Image | |
DEFAULT_SIZE = (220, 180) | |
# DEFAULT_SIZE = (300, 30) | |
# DEFAULT_SIZE = (300, 128) |
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
#!/usr/bin/env lua | |
--https://www.tutorialspoint.com/lua/lua_quick_guide.htm | |
requests = require 'requests' | |
inspect = require 'inspect' | |
response = requests.get{'http://httpbin.org/get', timeout=1} | |
json_data = response.json() |
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
from threading import Thread | |
class RestartableThread(Thread): | |
def __init__(self, *args, **kwargs): | |
self.init_args, self.init_kwargs = args, kwargs | |
super(RestartableThread, self).__init__(*args, **kwargs) | |
def clone(self): | |
r = RestartableThread(*self.init_args, **self.init_kwargs) |
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
#!/bin/bash | |
# INIT | |
/bin/echo " - Start snapshot - " | |
/bin/date >> /opt/resources/snap-hard-`/bin/date -I`.out | |
/bin/echo " " >> /opt/resources/snap-hard-`/bin/date -I`.out | |
/bin/echo " " >> /opt/resources/snap-hard-`/bin/date -I`.out |
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
import timeit | |
black_list = ["status", "components", "exposed_id", "external_id", "gaucha_id", "publish_scheduled", | |
"created", "origin_link", "canonical", "friendly_title", "friendly_title_history"] | |
input_data = { | |
"x": 1, | |
"_id": 1, | |
"_created": 1, | |
"_updated": 1, |
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
[distutils] | |
index-servers = | |
pypi | |
pypitest | |
[pypi] | |
repository=https://pypi.python.org/pypi | |
username=luiscoms | |
password= |
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
# Se tiver essa diretiva, a recursividade para, ou seja, | |
# esse é o arquivo raiz da configuração | |
root = true | |
# Comentários podem começar com ; ou # | |
# Pra todos os arquivos | |
# [*] | |
# Para arquivos em extensões abaixo | |
[{*.{c,cpp,conf,cfg,js,py,php,sh},Makefile}] | |
# Defino que serão todos utf-8 |
NewerOlder