Skip to content

Instantly share code, notes, and snippets.

@jampekka
jampekka / activity.py
Created April 2, 2017 20:56
/r/place activity animated heatmap
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
import pyximport; pyximport.install()
from pixcount import pixcount
import scipy.ndimage
data = np.load('diffs.npy')
ts = data[:,0]
frames = 1000
@maxlinc
maxlinc / spec_helper.rb
Created August 29, 2013 19:57
rspec puppet debugging
RSpec.configure do |conf|
conf.module_path = File.join(fixture_path, 'modules')
conf.manifest_dir = File.join(fixture_path, 'manifests')
conf.hiera_config = File.join(fixture_path, 'hiera.yaml')
end
# Not sure this works for all types of https://github.com/rodjek/rspec-puppet tests. I think it works with host tests
if ENV['PUPPET_DEBUG']
Puppet::Util::Log.level = :debug
Puppet::Util::Log.newdestination(:console)
@chanmix51
chanmix51 / bashlib.sh
Created September 18, 2011 16:46
Bash library to develop scripts
. $LIB_DIR/colors.sh
error_msg() {
echo -e "${COLOR_RED}ERROR:${COLOR_RESET} $1 " >&2;
}
notice() {
echo -e "${COLOR_BOLD}notice:${COLOR_RESET} $1" >&2;
}