Skip to content

Instantly share code, notes, and snippets.

View mgnisia's full-sized avatar

Moritz Gnisia mgnisia

View GitHub Profile
@mgnisia
mgnisia / tf_vars_sort.awk
Created February 10, 2023 10:47 — forked from yermulnik/tf_vars_sort.awk
Sort Terraform (HCL) file by Resource Block Names using `awk`
#!/usr/bin/env -S gawk -f
# for MACOS: brew install gawk
# https://gist.github.com/yermulnik/7e0cf991962680d406692e1db1b551e6
# Tested with GNU Awk 5.0.1, API: 2.0 (GNU MPFR 4.0.2, GNU MP 6.2.0)
# Usage: cat variables.tf | awk -f /path/to/tf_vars_sort.awk | tee sorted_variables.tf
# No licensing; yermulnik@gmail.com, 2021-2022
{
# skip blank lines at the beginning of file
if (!resource_type && length($0) == 0) next
@mgnisia
mgnisia / BoundaryConditions.py
Created June 4, 2020 09:36 — forked from ilciavo/BoundaryConditions.py
Poisson and Heat Equation with boundary conditions
#poisson solver
#u_xx = b(x)
%matplotlib inline
from __future__ import division
import numpy as np
from numpy import cos, sin, zeros, pi
from numpy.linalg import solve, norm
import matplotlib.pyplot as plt
from matplotlib import rcParams