Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Thomas wetlife

View GitHub Profile
@wetlife
wetlife / minimal-template.tex
Created June 18, 2019 06:09 — forked from Michael0x2a/minimal-template.tex
Minimal LaTeX template
View minimal-template.tex
\documentclass{article}
% General document formatting
\usepackage[margin=0.7in]{geometry}
\usepackage[parfill]{parskip}
\usepackage[utf8]{inputenc}
% Related to math
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\begin{document}
View latex-mimimal-working-example-of-a-book
\documentclass[a4paper,twoside]{scrbook}
\begin{document}
\title{Computer programing}
\author{nedlud}
\frontmatter
\maketitle
\tableofcontents
\mainmatter
\chapter{Introduction}
Some text ...
@wetlife
wetlife / report_hrefs.py
Created September 9, 2017 02:09
Find hrefs in file_path. Distinguish absolute hrefs by the presence of '://' then give counts of relative- and absolute-hrefs.
View report_hrefs.py
from bs4 import BeautifulSoup
from requests import request
from pprint import pprint
import re
file_path = './index.html'
with open(file_path, encoding='utf8') as file_object:
file_markup = file_object.read()
file_soup = bs(file_markup, 'lxml')
@wetlife
wetlife / sklearn-data-consumption.txt
Last active October 21, 2018 16:44 — forked from anonymous/gist:b6e4c0c2aa3b90f82c49af9e640a050a
MWE: ingest data via sklearn
View sklearn-data-consumption.txt
>>> from sklearn import preprocessing
>>> lb = preprocessing.LabelBinarizer()
>>> lb.fit_transform(['cat', 'dog', 'bird', 'cat'])
array([[0, 1, 0],
[0, 0, 1],
[1, 0, 0],
[0, 1, 0]])
@wetlife
wetlife / mandelplot.py
Created April 22, 2017 05:58
This is a plot of Mandelbrot's completely incomputable set.
View mandelplot.py
######################################################
######## mandelplot: plot the mandelbrot set #########
######################################################
import numpy as np # load numerical python
import matplotlib.pyplot as plt # load plotting tools
bailout = 10**62 # bound on the number of iterations
radial_pixels = 512 # resolution of plot
sequence = [-2 + 4/radial_pixels*count for count in range(radial_pixels)]
image = np.zeros((radial_pixels,radial_pixels))