Skip to content

Instantly share code, notes, and snippets.

View edisongustavo's full-sized avatar

Gustavo Muenz edisongustavo

View GitHub Profile
@edisongustavo
edisongustavo / gist:30c7f7dfaadfb2a36bdd0f3d9597d420
Created May 6, 2021 18:54
Moto failures after adding idna version
====================================================================================================================================================================== FAILURES ======================================================================================================================================================================
___________________________________________________________________________________________________________________________________________________________ test_http_proxying_integration ___________________________________________________________________________________________________________________________________________________________
@mock_apigateway
def test_http_proxying_integration():
responses_mock.add(
responses_mock.GET, "http://httpbin.org/robots.txt", body="a fake response"
)
region_name = "us-west-2"
@edisongustavo
edisongustavo / tabulate-tables-side-by-side
Created March 16, 2021 20:24
Prints tables generated with python-tabulate side by side
from tabulate import tabulate
def print_tables_side_by_side(*tables, spacing: int = 3):
string_tables_split = [tabulate(t, headers="firstrow").splitlines() for t in tables]
spacing_str = " " * spacing
num_lines = max(map(len, string_tables_split))
paddings = [max(map(len, s_lines)) for s_lines in string_tables_split]
Laps Time Cumulative Time Distance Avg Speed Elev Gain Elev Loss Avg Bike Cadence Max Bike Cadence Normalized Power® (NP®) Avg Power Avg W/kg Max Power Max W/kg Max Avg Power (20 min) Calories Max Speed Moving Time Avg Moving Speed
8 1:01.2 30:14 0.55 32.4 6 9 93 100 306 316 No Weight 640 No Weight -- 19 33.7 1:01 32.5
9 2:01.1 32:15 1.18 35.1 11 2 89 98 260 256 No Weight 359 No Weight -
def md5(fname):
import hashlib
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
mkdir build
cd build
set CMAKE_CONFIG="Release"
cmake -LAH -G"NMake Makefiles" ^
-DCMAKE_BUILD_TYPE="%CMAKE_CONFIG%" ^
-DCMAKE_PREFIX_PATH="%LIBRARY_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
[ 92%] Building CXX object SWIG_CGAL/Advancing_front_surface_reconstruction/CMakeFiles/_CGAL_Advancing_front_surface_reconstruction.dir/__/__/build-python/CGAL/CGAL_Advancing_front_surface_reconstructionPYTHON_wrap.cxx.obj
CGAL_Advancing_front_surface_reconstructionPYTHON_wrap.cxx
W:\Miniconda\conda-bld\._1481645623974\_b_env\Library\include\CGAL/GMP/Gmpzf_type.h(459): warning C4244: 'initializing': conversion from 'mp_bitcnt_t' to 'unsigned long', possible loss of data
W:\Miniconda\conda-bld\._1481645623974\_b_env\Library\include\CGAL/GMP/Gmpfr_type.h(265): warning C4244: 'argument': conversion from 'const CGAL::Gmpzf::Exponent' to 'long', possible loss of data
W:\Miniconda\conda-bld\._1481645623974\_b_env\Library\include\CGAL/GMP/Gmpfr_type.h(275): warning C4244: 'argument': conversion from 'const CGAL::Gmpzf::Exponent' to 'long', possible loss of data
W:\Miniconda\conda-bld\._1481645623974\_b_env\Library\include\CGAL/GMP/Gmpfr_type.h(288): warning C4244: 'argument': conversion from 'const CGAL::Gmpzf::Expo
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/RS/dyadic.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/RS/signat_1.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/CORE/CoreAux_impl.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/CORE/Gmp.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file cmake/modules/FindGMP.cmake
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/RS/dyadic.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/RS/signat_1.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/CORE/CoreAux_impl.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file include/CGAL/CORE/Gmp.h
(Stripping trailing CRs from patch; use --binary to disable.)
patching file cmake/modules/FindGMP.cmake
from __future__ import unicode_literals
class ValueAndString(object):
def __init__(self, value, string):
self.value = value
self.string = string
if type(string) != unicode:
raise ValueError('Error!')
struct SubCapitulo {
int indentation;
SubCapitulo[] subcapitulos;
};
void preencher_indentation(SubCapitulo[] capitulos, int indentation = 0, flattened_chapters = null) {
if (flattened_chapters == null) {
flattened_chapters = new Array();
}