Skip to content

Instantly share code, notes, and snippets.

View matthewfeickert's full-sized avatar
💭
☕ + 💻

Matthew Feickert matthewfeickert

💭
☕ + 💻
View GitHub Profile
@matthewfeickert
matthewfeickert / README.md
Last active March 4, 2024 06:24
Motivation for using Python virtual environments for easy sharing
@smithdanielle
smithdanielle / check.packages.r
Created April 1, 2014 13:23
Check if multiple R packages are installed. Install them if they are not,then load them into the R session.
# check.packages function: install and load multiple R packages.
# Check to see if packages are installed. Install them if they are not, then load them into the R session.
check.packages <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
# Usage example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kratsg
kratsg / ATLASSUSY_ReproducibleSummaryPlots.ipynb
Last active December 7, 2023 10:59
ATLAS SUSY Reproducible Summary Plots
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
@christopherlovell
christopherlovell / display.py
Last active November 18, 2023 22:22
display youtube video in jupyter notebook
from IPython.display import HTML
# Youtube
HTML('<iframe width="560" height="315" src="https://www.youtube.com/embed/S_f2qV2_U00?rel=0&amp;controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>')
# Vimeo
HTML('<iframe src="https://player.vimeo.com/video/26763844?title=0&byline=0&portrait=0" width="700" height="394" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe><p><a href="https://vimeo.com/26763844">BAXTER DURY - CLAIRE (Dir Cut)</a> from <a href="https://vimeo.com/dannysangra">Danny Sangra</a> on <a href="https://vimeo.com">Vimeo</a>.</p>')
@phinate
phinate / yield_prop.py
Last active August 8, 2023 17:11
three ways to propagate yields
import json
import pyhf
from pyhf.contrib.utils import download
import cabinetry
download("https://www.hepdata.net/record/resource/1935437?view=true", "bottom-squarks")
ws = pyhf.Workspace(json.load(open("bottom-squarks/RegionC/BkgOnly.json")))
patchset = pyhf.PatchSet(json.load(open("bottom-squarks/RegionC/patchset.json")))
ws = patchset.apply(ws, "sbottom_600_280_150")
cabinetry.workspace.save(ws, "bottom-squarks.json")
@Aerijo
Aerijo / latex_in_atom.md
Last active July 31, 2023 09:31
Setting up Atom for LaTeX

Disclaimer: I wrote the packages language-latex2e, autocomplete-latex, latex-wordcount, and hyperclick-latex. I still try to provide a list of all useful packages though, so let me know if I have missed one.

This is a general guide for how to get started with LaTeX in Atom.

NOTE: This guide assumes you already have LaTeX installed on your computer. If you do not, I recommend TeX Live.

#!/bin/bash -e
# check for CMSSW environment
if [ -z "$CMSSW_BASE" ]; then
echo '$CMSSW_BASE not set'
exit 1
fi
# check for python3 in actual CMSSW area
if ! (cd $CMSSW_BASE && scram tool info python3 >& /dev/null); then
@cben
cben / dodgetocat_v2.png
Last active April 1, 2023 13:16 — forked from alienlebarge/dodgetocat_v2.png
Is there an easy way to link image in a GIST ?
dodgetocat_v2.png