Skip to content

Instantly share code, notes, and snippets.

@aechiara
aechiara / export_skoob.py
Created December 13, 2016 13:37
Export data from skoob.com.br
import json, requests
url = 'https://www.skoob.com.br/v1/bookcase/books/271088/shelf_id:1/page:1/limit:50/'
resp = requests.get(url)
if resp.status_code != 200:
raise Exception('Erro acessando URL', resp.status_code)
lista = json.loads(resp.text)
def download(request, id):
arquivo = get_object_or_404(Arquivo, id_arquivo=id)
response = HttpResponse(FileWrapper(arquivo.file), content_type='application/zip')
response['Content-Disposition'] = 'attachment; filename={}'.format(os.path.basename(arquivo.file.name))
return response
#!/bin/sh
XXX_DB_VOLUME='/opt/hospedagem/site_x/mysql_data'
XXX_SITE_VOLUME='/opt/hospedagem/site_x/site_data'
# Run Mysql
echo "Iniciando Mysql"
mydql_id=$(docker run --restart=on-failure:5 -d --name site_x_mysql -p 4001:3306 dockerfile/mysql)
sleep 2
echo "Status ${mysql_id}"
<!DOCTYPE html>
<html>
<head data-gwd-animation-mode="quickMode">
<link href="gwdpagedeck_style.css" data-version="1.1" data-exports-type="gwd-pagedeck" rel="stylesheet">
<script data-source="custom.elements.min.js" type="text/javascript" src="custom.elements.min.js"></script>
<meta name="generator" content="Google Web Designer 1.1.3.1028">
<meta name="template" content="Banner 2.0.16">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@aechiara
aechiara / .vimrc
Last active August 29, 2015 13:57
meu vimrc
set nocompatible
set laststatus=2
set noshowmode
syntax enable,on
filetype plugin indent on
"Easier mapleader than the default "\"
let mapleader = ","
# coding: utf-8
def cpf_checksum(cpf):
"""
CPF Checksum algorithm.
"""
if cpf in map(lambda x: str(x) * 11, range(0, 10)):
return False