- 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
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 |
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
class SemVer { | |
public int compareVersion(String v1, String v2) { | |
String[] v1Parts = v1.split("\\."); | |
String[] v2Parts = v2.split("\\."); | |
int length = Math.max(v1Parts.length, v2Parts.length); | |
for (int i=0; i<length ;i++) { | |
int numV1 = (i < v1Parts.length)? Integer.parseInt(v1Parts[i]) : 0; | |
int numV2 = (i < v2Parts.length)? Integer.parseInt(v2Parts[i]) : 0; |
NewerOlder