Skip to content

Instantly share code, notes, and snippets.


Kyle Cranmer cranmer

View GitHub Profile
cranmer /
Last active August 19, 2022 20:18
Karabinder-elements control+a and control+e for begin and end of line

Microsoft office seems to over-ride control+a to be select all and control+e doesn't seem to do anything. This fixes that.

Add the remap_for_office.json file to ~/.config/karabiner/assets/complex_modifications/ then go to add complex modification and you should see a new rule called "Remap for office"

See also:

View example.tex
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
%\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
cranmer / gist:24f6b1f4074b65dd34f0
Created June 15, 2015 19:23
Embed custom.css into IPython for slides customization
View gist:24f6b1f4074b65dd34f0
from IPython.display import HTML
myf = open('custom.css')
htmlstring = "<style>%s </style>" %(
except IOError:
print "no file"
cranmer / gist:96c4930b87b98387a11a
Created October 17, 2014 18:40
Betterize with Arial font instead
View gist:96c4930b87b98387a11a
cranmer /
Created September 2, 2014 20:18
RooBSpline example
import ROOT
import numpy as np
def makeBSpline(w,interpParam, observable, pdfList, paramPoints):
# source code for these classes can be found here:
#if you don't have this class in your ROOT library, but have it locally
ROOT.gROOT.ProcessLine(".L RooBSpline.cxx+")
paramVec = ROOT.TVectorD(len(paramPoints))
cranmer / RooMomentMorphExample.C
Last active February 5, 2020 13:44
RooMomentMorph example for RooFit
View RooMomentMorphExample.C
#for python, look here:
void testMM(){
// #Make statistical model
w = new RooWorkspace("w");
x = w->var("x");
mu = w->var("mu");
frame = x->frame();
RooArgList pdfs;
cranmer /
Last active December 31, 2021 11:54
RooMomentMorph example for RooFit
#for C++ look here:
import ROOT
import numpy as np
def testMomentMorph():
#Going to make a few statistical models we want to interpolate
#initialize workspace with some common background part
w = ROOT.RooWorkspace('w')
x = w.var('x')