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 os | |
import requests | |
from functools import wraps | |
from flask import Flask, request | |
PARSE_SERVER_URL = os.environ['PARSE_SERVER_URL'] | |
PARSE_APPLICATION_ID = os.environ['PARSE_SERVER_URL'] | |
app = Flask(__name__) |
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
server { | |
listen [::]:{{ .NGINX_PORT }}; | |
listen {{ .NGINX_PORT }}; | |
server_name {{ .NOSSL_SERVER_NAME }}; | |
access_log /var/log/nginx/{{ .APP }}-access.log; | |
error_log /var/log/nginx/{{ .APP }}-error.log; | |
include {{ .DOKKU_ROOT }}/{{ .APP }}/nginx.conf.d/*.conf; |
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 timeit import default_timer as timer | |
from random import randrange, choice | |
from itertools import combinations | |
from dataclasses import dataclass | |
from operator import attrgetter | |
from io import StringIO | |
from typing import List, Optional, Sequence, Tuple | |
@dataclass |
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 __future__ import annotations | |
from copy import deepcopy | |
from enum import Enum | |
from functools import reduce | |
from heapq import nsmallest | |
from itertools import tee | |
from math import radians, sqrt, sin, cos, atan2 | |
from random import choices, random, shuffle, randrange | |
from statistics import mean | |
from operator import add |
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 itertools import combinations | |
from random import choice | |
players = ['Cristina', 'Rodrigo', 'Moises', 'Wagner', 'Arthur'] | |
league = list(combinations(players, 2)) | |
print(league) | |
def victory_host(ranking, host, away): | |
ranking[host] = ranking.get(host, 0) + 3 |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Mango: Informações, Busca e Download de diversos títulos de Mangá. | |
Através da string do titulo do mangá fornecida como parâmetro, | |
o script faz uma busca em serviços de leitura online de Mangá a procura | |
do titulo informado. Caso ache, providencia informações, e disponibiliza | |
para download. |
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 python:3.8-buster | |
WORKDIR /root | |
ADD https://github.com/official-stockfish/Stockfish/archive/sf_13.tar.gz /root | |
RUN tar xvzf *.tar.gz && cd Stockfish-sf_13/src \ | |
&& make net && make build ARCH=x86-64-modern | |
FROM python:3.8-slim-buster |
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 itertools import islice | |
class Node: | |
def __init__(self, data, previous=None, next=None): | |
self.data = data | |
self.previous = None | |
self.next = None | |
def __eq__(self, other): | |
if isinstance(other, self.data.__class__): |
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
#!/bin/sh | |
# The MIT License (MIT) | |
# Copyright (c) 2016 Cristina Silva <cristina.silva@openmailbox.org> | |
# and Ceres Rohana <ceres.rohana@gmail.com> | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to |
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
/* GuiaArquivo.c | |
* | |
* Código genérico para exemplificar consulta de arquivos binários. | |
* | |
* GNU General Public License | |
* Copyright 2014 Cristina Silva <cristina@openmailbox.org> | |
*/ | |
// Biblioteca básica para as funções de entrada e saida em C. | |
#include <stdio.h> |