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
version: '2' | |
services: | |
mysql: | |
image: mysql:5.7 | |
restart: always | |
# ports: | |
# - "3307:3306" | |
environment: | |
MYSQL_ROOT_PASSWORD: pass | |
MYSQL_DATABASE: mydb |
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 nyanpass/php5.5:5-fpm | |
RUN docker-php-ext-install pdo_mysql | |
RUN docker-php-ext-install mysql | |
RUN docker-php-ext-install mysqli | |
EXPOSE 9000 |
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
#pip install peewee | |
from peewee import * | |
db = MySQLDatabase('simplex', password='simplex', | |
user='root', | |
host='127.0.0.1', | |
port=3306) | |
class MonitoringLinks(Model): | |
id = PrimaryKeyField() |
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 time | |
from urllib import request | |
host = "https://www.buscape.com.br/notebook" | |
opener = request.build_opener() | |
request = request.Request(host) | |
request.add_header('user-agent', 'firefox') | |
start = time.time() | |
resp = opener.open(request) | |
# read one byte |
This file has been truncated, but you can view the full file.
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
{ | |
"rodada" : 3, | |
"atletas" : { | |
"37245" : { | |
"apelido" : "Guto Ferreira", | |
"pontuacao" : 0.94, | |
"scout" : {}, | |
"foto" : "https://s.glbimg.com/es/sde/f/2017/02/21/f52648766ac7a16d0625f73fbb3daa12_140x140.png", |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title></title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href="css/style.css" rel="stylesheet"> | |
</head> | |
<body> | |
Sensor de Luz |
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
{ | |
"liga": { | |
"liga_id": 221014, | |
"time_dono_id": 1277, | |
"clube_id": null, | |
"nome": "A...", | |
"descricao": "...", | |
"slug": "a", | |
"tipo": "A", | |
"tipo_flamula": 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
<?php | |
$logger = new Logger('name_app'); | |
$logger->pushProcessor(function(array $record){ | |
if($record['level_name'] >= Logger::ERROR){ | |
$record['context'] = debug_backtrace(); | |
} | |
$debug = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 10); | |
if(count($debug) >= 6 && isset($debug[6]['class'], $debug[6]['line'], $debug[6]['function'])){ |
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
<?php | |
/** | |
* sources: | |
* http://docs.guzzlephp.org/en/latest/handlers-and-middleware.html#middleware | |
* https://evertpot.com/222/ | |
* | |
*/ | |
use GuzzleHttp\Client; | |
use GuzzleHttp\Handler\CurlHandler; | |
use GuzzleHttp\HandlerStack; |
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
#export mongodb to json with pattern elasticsearch bulk insert without _id (mongodb) | |
mongoexport -h 127.0.0.1 --port 27017 -d db -c collection -f fields | sed '/"_id":/s/"_id":[^,]*,//' | awk '{print "{\"index\": {\"_index\": \"index_name\", \"_type\": \"type_name\"}}\n"$0}' > elasticsearch.json |
NewerOlder