Skip to content

Instantly share code, notes, and snippets.

View fperez's full-sized avatar

Fernando Perez fperez

View GitHub Profile
@fperez
fperez / ProgrammaticNotebook.ipynb
Last active April 5, 2024 12:00
Creating an IPython Notebook programatically
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / ipython-0.0.1.py
Created January 8, 2012 21:05
IPython 0.0.1, a simple script to be loaded as $PYTHONSTARTUP: of historical interest only...
#!/usr/bin/env python
"""
Interactive execution with automatic history, tries to mimic Mathematica's
prompt system. This environment's main features are:
- Numbered prompts (In/Out) similar to Mathematica. Only actions that produce
output (NOT assingments, for example) affect the counter and cache.
- The following GLOBAL variables always exist (so don't overwrite them!):
_p: stores previous result which generated printable output.
@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 / SimpleNeuralNets.ipynb
Last active April 19, 2022 18:52
Notes for "Why does deep and cheap learning work so well?" (ArXiv:1608.08225v1/cond-mat.dis-nn) by Lin and Tegmark.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fperez
fperez / TwitterGraphs.ipynb
Last active October 25, 2021 22:21
Exploring graph properties of the Twitter stream with twython, networkx and IPython
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 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 / nbmerge.py
Created June 23, 2015 01:04
Merge/concatenate multiple IPython notebooks into one.
#!/usr/bin/env python
# Note, updated version of
# https://github.com/ipython/ipython-in-depth/blob/master/tools/nbmerge.py
"""
usage:
python nbmerge.py A.ipynb B.ipynb C.ipynb > merged.ipynb
"""
import io