Skip to content

Instantly share code, notes, and snippets.

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

Matthew Feickert matthewfeickert

💭
☕ + 💻
View GitHub Profile
@stephensekula
stephensekula / extradimenions_5D_KK_example
Created June 23, 2017 16:27
A visualization of circle-compactified 5-D Kaluza-Klein extra dimensions.
from vpython import *
import math
# Create a display
scene2 = canvas(title='Kaluza-Klein Extra Dimensions - 5D',
x=0, y=0, width=1024, height=768,
center=vector(0,-20,0), background=vector(0,0,0))
@mcnees
mcnees / Example2.tex
Created September 3, 2017 01:20
Dirac delta example in PGF/TikZ
\documentclass[crop=true, border=10pt]{standalone}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
@mcnees
mcnees / Example1.tex
Created September 3, 2017 01:17
Shrinking sphere in LaTeX with PGF/TikZ
\documentclass[crop=true, border=10pt]{standalone}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\usepackage{tikz-3dplot}
@ibab
ibab / simple_fit.py
Created February 10, 2016 17:19
Simple fit with tensorflow
import numpy as np
import tensorflow as tf
from scipy.optimize import minimize
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
# Generate dataset
data = np.random.normal(0, 1, 1000)
@dguest
dguest / _h5ls.sh
Last active March 21, 2018 19:18
Autocomplete for h5ls
# bash completion function for hdf 'h5ls'
_h5ls()
{
local cur prev opts WORDS end
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="-h --help -d --data -r --recursive -S --simple"
local TAIL_WD=$(( ${#COMP_WORDS[@]} - ${COMP_CWORD} - 1 ))
$ kubectl logs -f jupyter-diana-2dhep-2dpyhf-2d652kacgz (sk-phoebe)
[I 13:08:48.908 NotebookApp] Writing notebook server cookie secret to /home/jovyan/.local/share/jupyter/runtime/notebook_cookie_secret
[I 13:08:49.393 NotebookApp] JupyterLab extension loaded from /srv/conda/lib/python3.6/site-packages/jupyterlab
[I 13:08:49.393 NotebookApp] JupyterLab application directory is /srv/conda/share/jupyter/lab
[I 13:08:50.390 NotebookApp] nteract extension loaded from /srv/conda/lib/python3.6/site-packages/nteract_on_jupyter
[I 13:08:50.393 NotebookApp] Will shut down after 600 seconds with no kernels or terminals.
[I 13:08:50.395 NotebookApp] Serving notebooks from local directory: /home/jovyan
[I 13:08:50.395 NotebookApp] The Jupyter Notebook is running at:
[I 13:08:50.395 NotebookApp] http://(jupyter-diana-2dhep-2dpyhf-2d652kacgz or 127.0.0.1):8888/user/diana-hep-pyhf-652kacgz/?token=...
[I 13:08:50.395 NotebookApp
@betatim
betatim / does-it-limit.py
Created March 30, 2020 20:56
Highly scientific rate limit checker
import requests
import time
S = requests.Session()
now = time.time()
while True:
r = S.get(YOUR_HOST_HERE)
now_ = time.time()
delta_t = now_ - now
import ROOT
from ROOT import gROOT,gPad,gStyle,TCanvas,TFile,TLine,TLatex,TAxis,TLegend,TPostScript
import os
global canvas, canvas
ROOT.gROOT.SetBatch(True)
ROOT.gStyle.SetOptStat(False)
ROOT.gStyle.SetOptTitle(False)
@neggert
neggert / hist_errorbars.py
Created April 16, 2012 14:49
Function for plotting histogram with error bars
import matplotlib.pyplot as plt
import numpy as np
import inspect
def hist_errorbars( data, xerrs=True, *args, **kwargs) :
"""Plot a histogram with error bars. Accepts any kwarg accepted by either numpy.histogram or pyplot.errorbar"""
# pop off normed kwarg, since we want to handle it specially
norm = False
if 'normed' in kwargs.keys() :
norm = kwargs.pop('normed')
@willgm
willgm / atom-package-list.txt
Last active May 12, 2021 17:55
My Atom Packages List
Stylus@3.1.0
angularjs@0.3.5
angularjs-styleguide-snippets@0.9.1
atom-jasmine@0.8.1
atom-ternjs@0.16.1
atom-typescript@10.1.12
clipboard-history@0.6.6
duplicate-line-or-selection@0.9.0
editorconfig@2.0.5
emmet@2.4.3