Skip to content

Instantly share code, notes, and snippets.

Avatar

Ogi Moore j9ac9k

View GitHub Profile
@j9ac9k
j9ac9k / graphviz.py
Created Oct 21, 2017
graphviz pandoc filter
View graphviz.py
#!/usr/bin/env python
"""
Pandoc filter to process code blocks with class "graphviz" into
graphviz-generated images.
Needs pygraphviz
"""
import os
@j9ac9k
j9ac9k / tikz.py
Created Oct 21, 2017
tikz pandoc-filter
View tikz.py
#!/usr/bin/env python
"""
Pandoc filter to process raw latex tikz environments into images.
Assumes that pdflatex is in the path, and that the standalone
package is available. Also assumes that ImageMagick's convert
is in the path. Images are put in the tikz-images directory.
"""
import os
View presentation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View presentation.slides.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
@j9ac9k
j9ac9k / gauss.py
Last active Jan 5, 2021
Gaussian Elimination in Python
View gauss.py
def gauss(A):
m = len(A)
assert all([len(row) == m + 1 for row in A[1:]]), "Matrix rows have non-uniform length"
n = m + 1
for k in range(m):
pivots = [abs(A[i][k]) for i in range(k, m)]
i_max = pivots.index(max(pivots)) + k
# Check for singular matrix
@j9ac9k
j9ac9k / convert.py
Last active Apr 18, 2019
Python Script to Convert ITerm XML color config files to Putty color registry files
View convert.py
import xml.etree.ElementTree as ET
import sys
try:
input_file = sys.argv[1]
tree = ET.parse(input_file)
except:
raise 'Provide xml filename to convert'
root = tree.getroot()