This file contains 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
__author__ = 'diego.garcia' | |
import socket | |
class UDPClient: | |
__IP = '255.255.255.255' | |
__PORT = 49152 | |
__udp_cli = '' |
This file contains 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
unit Singleton.Example; | |
interface | |
type | |
TMyClass = class | |
strict private | |
class var FInstance : TMyClass; | |
private | |
class procedure ReleaseInstance(); |
This file contains 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 http.server import BaseHTTPRequestHandler, HTTPServer | |
class Handler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(200, 'OK') | |
self.send_header('Content-type', 'application/json') | |
self.end_headers() | |
self.wfile.write(b'{"message": "hello world"}') |
This file contains 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
KEY: b | |
-KEY: o | |
--KEY: b | |
KEY: c | |
-KEY: a | |
--KEY: r | |
-KEY: u | |
--KEY: t | |
---KEY: e | |
KEY: t |
This file contains 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 concurrent.futures import ProcessPoolExecutor | |
import time | |
import muffin | |
app = muffin.Application('hello_world') | |
def get_msg(): |
This file contains 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
// By Type | |
// Go playground https://play.golang.org/p/lJOCJAq8WL | |
package main | |
import "fmt" | |
type ErrorX struct{} | |
func (e *ErrorX) Error() string { | |
return "It's error X" |
This file contains 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 asyncio | |
import json | |
import aiohttp | |
SCHOOL_URL_FMT = 'http://educacao.dadosabertosbr.com/api/escola/{}' | |
SEARCH_SCHOOL_URL = ( | |
'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?' | |
'situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&' |
This file contains 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
package logger | |
import ( | |
"bytes" | |
"io" | |
"log" | |
) | |
type FilteredWriter struct { | |
io.Writer |
This file contains 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 asyncio | |
import aiohttp | |
URL_LIST = [ | |
'http://google.com', | |
'http://abc.xyz', | |
'http://github.com', | |
'https://www.python.org/' |
This file contains 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 concurrent.futures import as_completed, ThreadPoolExecutor | |
from urllib.request import urlopen | |
import re | |
import sys | |
DEFAULT_REGEX = r'<input type="text" id="nacional" value="([^"]+)"/>' | |
CURRENCY = { | |
'dolar': 'http://dolarhoje.com/', | |
'euro': 'http://eurohoje.com/', |