Skip to content

Instantly share code, notes, and snippets.

View winterstream's full-sized avatar

Wynand Winterbach winterstream

  • Google
  • Zurich, Switzerland
View GitHub Profile
@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@guifromrio
guifromrio / compress-pdf-with-gs.md
Created August 30, 2013 14:39
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
@jcrudy
jcrudy / nonparametric_pymc.py
Last active May 29, 2023 09:55
An example of using a kernel density estimate as a prior in a pymc model that can be updated based on the posterior sample.
from scipy.stats.kde import gaussian_kde
import pymc
from math import log
from matplotlib import pyplot
def KernelSmoothing(name, dataset, bw_method=None, lower=float('-inf'), upper=float('inf'), observed=False, value=None):
'''Create a pymc node whose distribution comes from a kernel smoothing density estimate.'''
density = gaussian_kde(dataset, bw_method)
lower_tail = 0
upper_tail = 0
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active July 4, 2024 13:00
Backend Architectures Keywords and References