This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nocompatible " be iMproved, required | |
| let g:python3_host_prog = '/usr/local/opt/[email protected]/bin/python3.8' | |
| if empty(glob('~/.vim/autoload/plug.vim')) | |
| silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
| \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
| autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
| endif | |
| call plug#begin('~/.vim/plugged') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ################################## | |
| # | |
| # THE ARCHIVE TRACKER | |
| # | |
| # REF: https://gist.github.com/markwk/c85a8a72bc8c03d0f510262bb5219a34/ | |
| # | |
| # INTRODUCTION: | |
| # Daily script to navigate to a directory of plain text files, | |
| # add files to git repo, calculate key stats, store stats to csv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from IPython.display import set_matplotlib_formats | |
| set_matplotlib_formats('pdf', 'svg') | |
| import matplotlib | |
| import seaborn as sns | |
| sns.set(font_scale=1.3) | |
| sns.set_style("darkgrid", {"axes.facecolor": ".95"}) | |
| import matplotlib.pyplot as plt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Title: Composite Quasar Spectra From the Sloan Digital Sky Survey | |
| Authors: Vanden Berk D.E., Richards G.T., Bauer A., Strauss M.A., | |
| Schneider D.P., Heckman T.M., York D.G., Hall P.B., Fan X., Knapp G.R., | |
| Anderson S.F., Annis J., Bahcall N.A., Bernardi M., Briggs J.W., | |
| Brinkmann J., Brunner R., Burles S., Carey L., Castander F.J., | |
| Connolly A.J., Crocker J.H., Csabai I., Doi M., Finkbeiner D., | |
| Friedman S., Frieman J.A., Fukugita M., Gunn J.E., Hennessy G.S., | |
| Ivezic Z., Kent S., Kunszt P.Z., Lamb D.Q., Leger R.F., Long D.C., | |
| Loveday J., Lupton R.H., Meiksin A., Merelli A., Munn J.A., | |
| Newberg H.J., Newcomb M., Nichol R.C., Owen R., Pier J.R., Pope A., |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################## | |
| #emcee example: | |
| ########################################## | |
| import numpy as np | |
| import emcee | |
| # Number of samples for each chain. | |
| N_samp = 1000 | |
| def log_prob(x): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| #This builds vim with python + python3 support in a conda environment. No sudo required! Replace the directories to your own. | |
| vi_cv_path_python=/mnt/home/mcranmer/miniconda3/envs/py27/bin/python \ | |
| vi_cv_path_python3=/mnt/home/mcranmer/miniconda3/envs/main/bin/python \ | |
| ./configure \ | |
| --with-features=huge \ | |
| --enable-multibyte \ | |
| --enable-rubyinterp=yes \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " Delete up to begin{document}, and from end{document} to before the bibliography. | |
| :%s/\\cite{[a-zA-Z0-9_]\+}/REF/g | |
| :%s/\\citealt{[a-zA-Z0-9_]\+}/REF/g | |
| :%s/\\cref{[a-zA-Z0-9_:]\+}/REF/g | |
| :%s/\\caption{//g | |
| :%s/\$\$.\{-}\$\$/REF/g | |
| :%s/\$.\{-}\$/REF/g | |
| :%s/\\[a-zA-Z_]\+{.*}/ /g | |
| :%s/\\[a-zA-Z_]\+/ /g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def plotdf(df, x, y, sample=10000): | |
| df = df[[x, y]].sample(sample).copy() | |
| for col in [x, y]: | |
| df = df[(df[col] > df[col].quantile(0.01)) & (df[col] < df[col].quantile(0.99))] | |
| df.plot( | |
| x, y, | |
| linestyle='', marker='.', | |
| markersize=0.1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def plotdf(df, x, y, c=None, sample=10000, alpha=0.5, color=None, | |
| cmap='viridis', clabel=None, xlabel=None, ylabel=None, | |
| noise_df=None, percentile=0.98, use_noise_df_for_framing=False, | |
| noise_alpha=0.1): | |
| cols_to_get = [x, y] | |
| if c is not None: | |
| cols_to_get.append(c) | |
| df = df[cols_to_get] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy | |
| from cffi import FFI | |
| ffi = FFI() | |
| ffi.cdef(""" | |
| void single_test(double *x, int n); | |
| void multi_test(double **x, int n, int m); | |
| """) | |
| C = ffi.dlopen("./simple.so") |