Skip to content

Instantly share code, notes, and snippets.

View NicoJG's full-sized avatar

Nico J. Guth NicoJG

View GitHub Profile
@NicoJG
NicoJG / size_apple_atom_earth.py
Created September 25, 2025 11:17
Size comparison between atom and earth using a fruit analogue
import matplotlib.pyplot as plt
import numpy as np
# In Feynmans lectures he explains the size of an atom in the following way:
# If you imagine rescaling an apple to the size of the earth then an atom in the apple would be the size of the original apple
# I wanted to see if this is a correct comparison
r_atom1 = 1e-10 # m
r_atom2 = 2e-10 # m
r_earth = 6.35675e6 # m
@NicoJG
NicoJG / gist:65b3363a43a4117856912a288f8a4298
Last active September 29, 2023 08:46
Add VSCode to the Chalmers Linux computers

This is a quick tutorial how to install the newest version of VSCode on the Devuan/xfce Linux that is on the Chalmers computers. A similar approach should work with pretty much any program you want to install.

  • Open the Terminal
  • Download the latest VSCode (the .tar.gz file!): curl -o ~/vscode.tar.gz -L "https://code.visualstudio.com/sha/download?build=stable&os=linux-x64"
  • Extract VSCode: tar -xf ~/vscode.tar.gz
  • Add VSCode to the PATH variable: echo 'export PATH="$HOME/VSCode-linux-x64:$PATH"' >> ~/.bashrc (or ~/.zshrc if you use ZSH)
  • Restart the Terminal
  • Now the program can be started in the terminal using code or code {working_directory_path}
    • add a single & after the command to not block the terminal
  • Remove the downloaded package: rm -f ~/vscode.tar.gz
@NicoJG
NicoJG / zsh_install_and_adjust.txt
Created September 19, 2021 10:35
WSL / Terminal better with Zsh instead of Bash, cool styles
zsh and Oh my zsh
Windows Terminal Color Scheme: Solarized Dark Higher Contrast https://windowsterminalthemes.dev/?theme=Solarized%20Dark%20Higher%20Contrast
Font: DejaVuSansMono NF (Nerdfonts) https://www.nerdfonts.com/font-downloads
Maybe Fuzzy Search
For Windows Terminal: "bellStyle": "none","background": "#000000",...
For Background in "defaults":
"backgroundImage": "C:/Users/Nico/Pictures/Helix-Nebula.jpg",
"backgroundImageOpacity": 0.3
@NicoJG
NicoJG / WSL_Python_LaTeX_on_Win10.txt
Last active September 19, 2021 10:36
WSL, Python, LaTeX... auf Windows 10 installieren und einrichten
https://docs.microsoft.com/de-de/windows/wsl/install-win10
testen ob "wsl --install" im PowerShell (als Administrator) funktioniert.
wenn nicht:
WSL aktivieren:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
VirtualMachine aktivieren:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
@NicoJG
NicoJG / Makefile
Created July 19, 2021 12:04
Makefile oberer Ordner für Max und Samuel
all: latex plots
latex:
make -C latex
plots:
make -C python
clean:
make -C latex clean
@NicoJG
NicoJG / Makefile
Created July 19, 2021 11:59
Makefile für Max und Samuel
all: PFAD_ZUM_PLOT1 PFAD_ZUM_PLOT2
PFAD_ZUM_PLOT1: PFAD_ZUR_PYTHON_DATEI1 | build
TEXINPUTS=$$(pwd)/../..: MATPLOTLIBRC=../../matplotlibrc python PFAD_ZUR_PYTHON_DATEI1.py
PFAD_ZUM_PLOT2: PFAD_ZUR_PYTHON_DATEI2 | build
TEXINPUTS=$$(pwd)/../..: MATPLOTLIBRC=../../matplotlibrc python PFAD_ZUR_PYTHON_DATEI2.py
build:
mkdir -p build
@NicoJG
NicoJG / .bashrc
Created July 18, 2021 12:29
Toolbox Workshop ~/.bashrc (Ende)
# for Anaconda
. "$HOME/.local/anaconda3/etc/profile.d/conda.sh"
conda activate
# for LaTeX
export PATH="$HOME/.local/texlive/2020/bin/x86_64-linux:$PATH"
# for VcXsrv
export XDG_RUNTIME_DIR="$HOME/.temp"
# export DISPLAY=`grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0
@NicoJG
NicoJG / printcode.sh
Created June 29, 2021 19:54
Print Python Code as PDF
#!/bin/bash
# pretty prints a python code file to a pdf using latex
# usage:
# bash printcode.sh <input_file> <output_file(optional)>
# or
# ./printcode.sh <input_file> <output_file(optional)>
input_file=$1