Skip to content

Instantly share code, notes, and snippets.

@fperez
fperez / main.tex
Last active June 15, 2023 19:28
A simple tex file to test the fontawesome5 package as a replacement for ifsym
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% LaPreprint: PREPRINT TEMPLATE
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[9pt,arxiv]{lapreprint}
% Import packages
\usepackage[version=4]{mhchem} % For chemical notation
\usepackage{siunitx} % For SI units
\usepackage{pdflscape} % For putting pages in landscape mode
@fperez
fperez / bug-duplicate-cells.ipynb
Created February 17, 2023 20:10
Bug in JupyterLab: notebook cells duplicated by RTC engine
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / GHAUTH.ipynb
Last active August 27, 2022 22:01
Using Git with minimal password hassles from the DataHub, thaks to gh-scoped-creds
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / env-update.py
Created August 26, 2022 09:15
Update an environment.yml file dependencies according to the current environment
#!/usr/bin/env python
"""
Refresh an environment yaml file to current versions.
This script reads an existing `environment.yml` file (for Conda/Mamba
environments) and writes out a new file listing the same packages, but listing
all currently available versions of the listed packages.
For an alternate approach, that queries PyPI/Conda-Forge to gather the most
recent versions of all packages, see @yuvipanda's similar script at
@fperez
fperez / copy_trees.py
Created October 14, 2021 22:30
Old tree-copying script to use in sphinx builds
#!/usr/bin/env python
"""Copy data files to final html directory.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import sys
@fperez
fperez / README.md
Last active September 2, 2021 22:10
Notebook saving problem with JupyterLab 3.1.x

Saving problems in JupyterLab 3.1.x

Binder

The notebook in this gist is meant to illustrate a problem we're experiencing with a notebook that often fails to save at all when attempting to write to it from a cloud-hosted bub.

See the saving-bug notebok for more details.

@fperez
fperez / zip-errors.ipynb
Last active August 27, 2021 04:02
Demo of issues with zip file downloads from JupyterLab
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / LogisticRegressionPart2.ipynb
Created November 8, 2018 16:50
LogisticRegression notebook from Data100 - test for load/kernel creation time on JupyterLab. On my system (2017 13" MBP) this nb takes 14s to open and 15s *extra* to get a kernel with JLab 0.35.4, and 4s total in Classic (no extra time for kernel)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / copy_trees.py
Created April 27, 2018 20:33
Copy tree of files to sphinx's output build directory to preserve structure of source but make some files available for later download in final build.
#!/usr/bin/env python
"""Copy data files to final html directory.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import sys
@fperez
fperez / README.md
Last active July 1, 2021 04:43
Polyglot Data Science with IPython

Polyglot Data Science with IPython & friends

Author: Fernando Pérez.

A demonstration of how to use Python, Julia, Fortran and R cooperatively to analyze data, in the same process.

This is supported by the IPython kernel and a few extensions that take advantage of IPython's magic system to provide low-level integration between Python and other languages.

See the companion notebook for data preparation and setup.