Skip to content

Instantly share code, notes, and snippets.

View jaanli's full-sized avatar
🍉
Hungry

Jaan Lı 李 PhD jaanli

🍉
Hungry
View GitHub Profile
@jaanli
jaanli / 2017-06-21-tea-talk-development.md
Last active December 3, 2018 20:38
Quick overview of snapshot of dev environment / workflow

Towards a better mac development environment in 2018

Progress, perspectives, & new beginnings.

Advice: Install everything. Go all-in on all the suggested tools for a week, then see what sticks. Start using all of them at once. There's a large 'activation energy' to switching tools but it is worth the up-front investment for a lifetime of saved milliseconds on everyday tasks like switching directories, etc.

Useful tools:

  • brew cask: install most desktop applications brew cask install spotify evernote simplenote dropbox vlc slack 1password skim caffeine mactex skype anaconda google-chrome alfred iterm2 flux spectacle rescuetime sublime-text macbreakz little-snitch
@jaanli
jaanli / Dockerfile
Created June 6, 2017 18:36
Dockerfile for dotfiles with vim + tmux + c++ dev environment & private github ssh key support. Using dotfiles from https://github.com/altosaar/dotfiles
# Fixed ubuntu version
FROM ubuntu:16.04
# Install Ruby and Rails dependencies
RUN apt-get update && apt-get install -y \
tmux \
gdb \
gcc \
g++ \
python \
@jaanli
jaanli / black_box_vi_bayesian_linear_regression.py
Created February 11, 2017 17:32
Black box variational inference for Bayesian linear regression. Numpy and scipy only.
"""Use black-box variational inference (https://arxiv.org/abs/1401.0118) to
fit Bayesian linear regression (https://en.wikipedia.org/wiki/Bayesian_linear_regression)
and ensure it gets the analytic posterior mean from wikipedia.
"""
import numpy as np
import scipy.stats
def generate_data(cfg):
"""synthetic data:
@jaanli
jaanli / tensorflow_util.py
Last active October 20, 2016 16:23
Utility functions for tensorflow and tensorboard
import tensorflow as tf
from tensorflow.core.framework import summary_pb2
pprint = lambda x, msg: tf.Print(x, [x], message=msg)
def scalar_summary(tag, value):
"""Create a scalar summary and add it to the collection if it doesn't exist."""
if summary_exists(tag) is None: