Skip to content

Instantly share code, notes, and snippets.

View ChrisAichinger's full-sized avatar

Christian Aichinger ChrisAichinger

View GitHub Profile
@ChrisAichinger
ChrisAichinger / COVID Variant Model.ipynb
Created January 16, 2022 17:16
Covid Variant Model: showing how a more infectious variant out-competes others
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ChrisAichinger
ChrisAichinger / htmlpdf.js
Last active August 16, 2022 20:20
htmlpdf.js -- Convert HTML to PDF using Google Chrome/Chromium
#!/usr/bin/env node
// htmlpdf.js -- Convert HTML to PDF using Google Chrome/Chromium
// Usage:
// node htmlpdf.js input.html output.pdf
// node htmlpdf.js https://google.com output.pdf
//
// Using Chrome/Chromium via puppeteer provides support for modern web
// technologies (CSS grid, etc.) and pixel-perfect rendering.
// Thus, this script correctly transforms websites where PhantomJS or wkhtmltopdf fail.
@ChrisAichinger
ChrisAichinger / dataurlify.py
Last active February 25, 2019 07:34
Embed images in HTML file as dataurl
#!/usr/bin/python3
import os
import argparse
import base64
import mimetypes
import re
RE = b'src="([^"]*)"'
@ChrisAichinger
ChrisAichinger / angle_helpers.py
Created June 14, 2016 05:16
Functions for working with angles
import math
def average_angles(angles):
"""Average (mean) of angles
Return the average of an input sequence of angles. The result is between
``0`` and ``2 * math.pi``.
If the average is not defined (e.g. ``average_angles([0, math.pi]))``,
<form class="form-horizontal" id="comment-form" ng-show="CommentAPI.connected">
<fieldset>
<legend>Post a comment</legend>
<div class="form-group">
<label for="postcomment-homepage" class="col-lg-2 control-label">Homepage</label>
<div class="col-lg-10">
<input class="form-control" id="postcomment-homepage" placeholder="Homepage" type="url"
maxlength="150" ng-model="comment.homepage">
</div>
let $LANG = 'en_US.UTF-8'
let $LC_MESSAGES = 'en_US.UTF-8'
set langmenu="en_US.utf-8"
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,latin1
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim