Skip to content

Instantly share code, notes, and snippets.

View fabiofortkamp's full-sized avatar

Fábio Fortkamp fabiofortkamp

View GitHub Profile
@fabiofortkamp
fabiofortkamp / calculate_radial_remanence.py
Created October 7, 2019 19:58
How to calculate radial remanence directions
import numpy as np
# example input parameters
phi_S_IV = 50
# how much each segment occupies of the whole magnet region
fractions_phi = np.array([20,20,20,20,20])
assert sum(fractions_phi) == 100
@fabiofortkamp
fabiofortkamp / custom_errors.py
Created October 23, 2019 13:19
Definiing custom exceptions in Python with a meaningful message
class InvalidParameterError(ValueError):
pass
@fabiofortkamp
fabiofortkamp / ST1GEE1.bunch
Created March 23, 2020 21:06
Example bunch file that I use to prepare classes (file names are in Portuguese)
# Comments start with a hash symbol, blank lines are ignored
# Use @@ to hide all visible apps. Usually used at the top of the file
# before launching the rest of the bunch
@@
# Include a line starting with a dash to open specific
# files in the app
# If the first file listed is "XX", all open windows
# for the app will be closed first
@fabiofortkamp
fabiofortkamp / latex-problem-set.tex
Created October 8, 2020 13:01
LaTeX template for college problem sets
\documentclass[english,brazil,shortlabels,article]{techreport}
%% see https://github.com/fabiofortkamp/techreport
%% I honestly cannot remember where I got this from
\newenvironment{problem}[2][Problem]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\usepackage{siunitx}
\usepackage{enumitem}
\usepackage{pdfpages}
@fabiofortkamp
fabiofortkamp / Python3_7_16_on_CentOS_6_10.md
Last active May 18, 2023 11:47 — forked from leosaa/Python3_7_0_onRHEL_Centos_6.md
install python 3.7.0 on RHEL/Centos 6.9

How to install Python 3.7.16 on CentOS 6.10

This is an introduction to building and installing Python 3.7.16 from source on Centos 6.10. Unfortunately python 3.7.16 requires specifics version of openssl and Centos 6.10 does not provides these versions: So previous to configure python, you have to configure zlib and then openssl.

Requirements

  • zlib 1.1.3 (better 1.1.4) or upper
  • openssl 1.1.0 or upper
  • Also, you will need libffi-devel rpm