Skip to content

Instantly share code, notes, and snippets.


Fábio Fortkamp fabiofortkamp

View GitHub Profile
fabiofortkamp / latex-problem-set.tex
Created Oct 8, 2020
LaTeX template for college problem sets
View latex-problem-set.tex
%% see
%% I honestly cannot remember where I got this from
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
fabiofortkamp / ST1GEE1.bunch
Created Mar 23, 2020
Example bunch file that I use to prepare classes (file names are in Portuguese)
View ST1GEE1.bunch
# 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 /
Created Oct 23, 2019
Definiing custom exceptions in Python with a meaningful message
class InvalidParameterError(ValueError):
fabiofortkamp /
Created Oct 7, 2019
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 / closewindows.ahk
Created Sep 25, 2019
AutoHotKey script to close window whose name is passed on as argument
View closewindows.ahk
; This script closes the window name passed as argument, e.g.
; AutoHotkey.exe closewindow.ahk "Visual Studio Code"
; To match strings anywhere in the window title
SetTitleMatchMode 2
If (WinExist(A_Args[1]))
function closeapp() {
osascript -e "quit app \"$1\""
fabiofortkamp /
Last active Sep 25, 2019
Example prm stop script for my "paper" project, on Windows
# Sincroniza de volta mudanças feitas
git push origin
# ver explicações abaixo para esses comandos
cf PaperMagneticProfiles_JBSMSE.tex
closew "paper-magnetic-profiles - Visual Studio Code"
closew "Sourcetree"
closew "Outline_Paper_Profiles"
fabiofortkamp /
Last active Sep 25, 2019
Example prm start script to work on a paper, on Windows
cd $HOME/latex-writing/paper-magnetic-profiles/
# sync repo
git pull origin master
# open Visual Studio Code to edit and run scripts
code -n .
# Sourcetree is a Git client
# function to close the buffer corresponding to a given file in emacs
# cf = close file
function cf() {
emacs -e "(if (get-buffer \"$1\") (kill-buffer \"$1\"))"
fabiofortkamp / disable_jupyter_scrolling.js
Created Jul 12, 2017
How to disable scrolling in Jupyter notebooks
View disable_jupyter_scrolling.js
// don't forget to put the following cell magic,
// if used inside a Jupyter notebook
// %%javascript
IPython.OutputArea.auto_scroll_threshold = 9999;