Skip to content

Instantly share code, notes, and snippets.

View AugustKarlstedt's full-sized avatar
☮️

August Karlstedt AugustKarlstedt

☮️
View GitHub Profile
@DuaneNielsen
DuaneNielsen / em_algo.py
Created January 15, 2020 05:53
EM algorithm - 1D Uses logprob bayes update for numerical stability
import torch
from torch.distributions.normal import Normal
import matplotlib.pyplot as plt
"""
EM algo demo, in pytorch
"""
n = 40 # must be even number
@AugustKarlstedt
AugustKarlstedt / update.sh
Created April 30, 2019 18:46
update all outdated python packages
pip3 list --outdated | awk '{print $1}' | tail -n +3 | xargs pip3 install -U
@gyndav
gyndav / Dockerfile
Last active August 6, 2023 20:56
install Scala and sbt on Alpine Linux
FROM openjdk:8u151-jre-alpine
ENV SCALA_VERSION=2.12.4 \
SCALA_HOME=/usr/share/scala
# NOTE: bash is used by scala/scalac scripts, and it cannot be easily replaced with ash.
RUN apk add --no-cache --virtual=.build-dependencies wget ca-certificates && \
apk add --no-cache bash curl jq && \
cd "/tmp" && \
wget --no-verbose "https://downloads.typesafe.com/scala/${SCALA_VERSION}/scala-${SCALA_VERSION}.tgz" && \
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active June 25, 2024 07:29
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@connordavison
connordavison / inject.js
Created December 31, 2015 14:06
Inject MathJax into the page (protocol agnostic).
(function () {
var cdn, config;
if (typeof MathJax !== "undefined" && MathJax !== null) {
return;
}
config = document.createElement('script');
config.setAttribute('type', 'text/x-mathjax-config');
config.innerHTML = "MathJax.Hub.Config({\n tex2jax: {inlineMath: [['$','$'], ['\\\\(','\\\\)']]}\n});";