Skip to content

Instantly share code, notes, and snippets.

@tscholl2
tscholl2 / most-used-characters.sh
Last active March 29, 2017 23:02
most used characters in some files
cat *.go | python3 -c "from sys import stdin;a=[c for c in stdin.read() if c.strip() != ''];b=[(a.count(c),c) for c in set(a)];b.sort();b.reverse();print('\n'.join(map(lambda x: '%d\t%s'%x,b)))"
@tscholl2
tscholl2 / tex-graphs.py
Created April 19, 2017 15:32
TeX'd graphs in sage
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
plt.rc('font',**{'family':'serif','serif':['Computer Modern Roman'],'size':14})
@tscholl2
tscholl2 / profile.sage
Created August 29, 2017 15:44
profile picture
E = EllipticCurve_from_j(GF(127)(1728))
g = E.plot(size=25,aspect_ratio=1)
g.save("./F_127 j_1728.svg")
@tscholl2
tscholl2 / index.html
Last active August 31, 2017 02:39
caching and promis-ing in hyperapp
<html>
<head>
<script src="https://unpkg.com/hyperapp@0.12.0"></script>
</head>
<body>
<script src="main.js"></script>
</body>
@tscholl2
tscholl2 / Dockerfile
Last active January 19, 2018 19:59
sage in docker with extras
FROM sagemath/sagemath:8.0-2
ARG SAGE_BRANCH=master
EXPOSE 8888
RUN echo && \
# update system
apt-get update && apt-get install -y && \
# install some dependencies for gifs and animations
apt-get install -y imagemagick ffmpeg && \
# install tex
<!DOCTYPE html>
<head>
<script type="text/javascript">
const grades = [
"A+",
"A",
"A-",
"B+",
"B",
@tscholl2
tscholl2 / index.html
Created January 14, 2019 02:55
mini app that turns latex commands into unicode
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Latex to Unicode</title>
<link
rel="stylesheet"
href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
/>
@tscholl2
tscholl2 / Dockerfile
Last active April 8, 2019 19:19
Dockerfile for TexStudio
FROM debian:stretch
# setup: language and ensure that external fonts and doc folders exists
RUN export LANG=C.UTF-8 &&\
mkdir -p /usr/share/fonts/external/ &&\
mkdir /doc/
# install utilities, texlive, ghostscript, and remove unused docs
RUN apt-get clean &&\
apt-get update &&\
\documentclass[12pt]{letter}
\date{\today}
\signature{FROMWHO???}
\address{
FROMWHERE??? \\
{\tt CONTACTEMAIL???}
}
@tscholl2
tscholl2 / template.tex
Last active June 28, 2019 15:29
tex template
\documentclass{article}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{xcolor}
\newcommand{\public}[1]{\textcolor[rgb]{0.024,0.408,0.024}{#1}}
\newcommand{\private}[1]{\textcolor[rgb]{0.661,0.035,0.035}{#1}}
\newcommand{\FF}{\mathbb{F}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\ZZ}{\mathbb{Z}}