Skip to content

Instantly share code, notes, and snippets.

View maxdevblock's full-sized avatar
☮️
peace, no war

MaxDevBlock maxdevblock

☮️
peace, no war
View GitHub Profile
@maxdevblock
maxdevblock / stan_demo.py
Created June 1, 2020 07:41 — forked from sergiosonline/stan_demo.py
Jupyter Notebook accompanying "Painless Introduction to Applied Bayesian Inference Using PyStan"
#!/usr/bin/env python
# coding: utf-8
# # Intro to PyStan
# Stan is a computation engine for Bayesian model fitting. It relies on HMC to sample from the posterior distribution of the desired model.
#
# Here are the detailed installation steps to set up Stan: https://pystan.readthedocs.io/en/latest/installation_beginner.html
#
# For MacOS:
@maxdevblock
maxdevblock / onlinenow.py
Created February 19, 2019 16:09 — forked from dfalk/onlinenow.py
django online users
from django.core.cache import cache
from django.conf import settings
from django.contrib.auth.models import User
ONLINE_THRESHOLD = getattr(settings, 'ONLINE_THRESHOLD', 60 * 15)
ONLINE_MAX = getattr(settings, 'ONLINE_MAX', 50)
def get_online_now(self):
return User.objects.filter(id__in=self.online_now_ids or [])