GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
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 socket | |
import select | |
from logzero import logger | |
# python forwarder.py localhost:1337 ipinfo.io:80 | |
# curl -v http://localhost.com:1337 -H "Host: ipinfo.io" | |
# video: https://www.youtube.com/watch?v=32KKwgF67Ho | |
class Forwarder: |
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 urllib.parse import urljoin | |
from bs4 import BeautifulSoup | |
import argparse | |
#%% Example | |
# one pdf | |
# python all_pdf_dl.py -l https://memento.epfl.ch/academic-calendar/ --save-here | |
# many pdfs |
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
version: '2' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:3.3.0 | |
hostname: zookeeper | |
ports: | |
- "2181:2181" | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 |
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
pragma solidity >=0.8.0 <0.9.0; | |
// SPDX-License-Identifier: MIT | |
/// [MIT License] | |
/// @title Base64 | |
/// @notice Provides a function for encoding some bytes in base64 | |
/// @author Brecht Devos <[email protected]> | |
library Base64 { | |
bytes internal constant TABLE = | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; |
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:latest | |
ADD requirements.txt /requirements.txt | |
RUN python3.6 -m venv /venv \ | |
&& /venv/bin/pip install -U pip \ | |
&& LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "/venv/bin/pip install --no-cache-dir -r /requirements.txt" | |
ENV PYTHONUNBUFFERED 1 | |
# Copy your application code to the container (make sure you create a .dockerignore file if any large files or directories should be excluded) | |
RUN mkdir /code/ |
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
## This is the text editor interface. | |
## Anything you type or change here will be seen by the other person in real time. | |
import itertools | |
from collections import defaultdict | |
class Cooccurrence: | |
def __init__(self): | |
self.__counts = defaultdict(int) | |
def append(self, line): |
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
class Person (db.Document): | |
name = db.StringField(required=True) | |
created_date = db.ComplexDateTimeField(default=datetime.datetime.utcnow(), required=True) | |
def to_dict(self): | |
return helper.mongo_to_dict(self,[]) | |
#helper.py | |
def mongo_to_dict(obj, exclude_fields): |