Skip to content

Instantly share code, notes, and snippets.

@zaxtax
zaxtax / EXAMPLE.service
Created April 25, 2024 00:40 — forked from fcangialosi/EXAMPLE.service
Automatically start long-running script on boot and keep it running with systemd
[Unit]
Description=Description of this service
[Service]
Type=simple
ExecStart=/usr/bin/nohup /path/to/server.sh
Restart=always
RestartSec=30
StandardOutput=/path/to/log
StandardError=/path/to/log
@zaxtax
zaxtax / progress_bar_test.ipynb
Last active April 2, 2024 11:25
Example notebook showing multiple chain progress bars for blackjax
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zaxtax
zaxtax / ln_cass.py
Created March 30, 2024 14:13
LN-CASS prior implementation in pymc
# Implementation of the logit-normal continuous analogue of the spike-and-slab (LN-CASS) prior
# From https://royalsocietypublishing.org/doi/full/10.1098/rsif.2018.0572
import pymc as pm
import numpy as np
import matplotlib.pyplot as plt
mu = 0
tau = 5
sigma = 10
with pm.Model() as m:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zaxtax
zaxtax / reading-list.rst
Created December 19, 2021 23:44 — forked from alexjc/reading-list.rst
Reading List on Texture Synthesis
@zaxtax
zaxtax / README.md
Created March 1, 2021 23:27 — forked from lmullen/README.md
Getting the Ace editor to work with gitit

The file page.st goes in the templates/ directory in the Gitit wiki home directory. You'll put the Ace JavaScript and CSS files in static/.

#!/bin/sh
TT=`env TZ=Asia/Tokyo date`
ST=`env TZ=Asia/Singapore date`
BT=`env TZ=Europe/Berlin date`
LT=`env TZ=Europe/London date`
ET=`env TZ=America/New_York date`
PT=`env TZ=US/Pacific date`
HT=`env TZ=Pacific/Honolulu date`
DT=`env TZ=Etc/GMT+12 date`
@zaxtax
zaxtax / CPS.rkt
Created September 14, 2019 00:25
Implementing bits of Danvy and Filinski papers Abstracting Control and Representing Control
#lang racket
;;;; CPS translaions written with guidance from Ken Shan's notes
;;;; and Danvy & Filinkski's paper Abstracting Control
(define empty-env '())
(define (extend-env name value env)
(cons (list name value) env))
@zaxtax
zaxtax / hist.py
Last active June 5, 2017 17:56
Histogram from the command line
#!/usr/bin/env python3
import click
import numpy as np
import sys
class IntOrStr(click.ParamType):
name = 'int/str'
{-# LANGUAGE FlexibleInstances #-}
-- | An implementation of Section 3, Local Type Argument Synthesis, from the
-- paper /Local Type Inference/ by Pierce and Turner.
module Infer where
import Control.Monad (foldM, join, zipWithM)
import Data.Function (on)
import Data.List (foldl', groupBy, intercalate, intersect, nub)