Create a parallel profile
ipython profile create --parallel --profile=slurm
cd into ~/.ipython/profile_slurm/
#!/bin/zsh | |
# A version of the 'timeout' command that works with shell functions | |
# | |
# Usage: | |
# source timeout_fn.sh | |
# timeout_fn DURATION COMMAND [ARG]... | |
timeout_fn () { | |
local timeout=$1 | |
shift |
# Local: | |
# https://stackoverflow.com/questions/21151178/shell-script-to-check-if-specified-git-branch-exists | |
# test if the branch is in the local repository. | |
# return 1 if the branch exists in the local, or 0 if not. | |
function is_in_local() { | |
local branch=${1} | |
local existed_in_local=$(git branch --list ${branch}) | |
if [[ -z ${existed_in_local} ]]; then | |
echo 0 |
# First, we need to find our device. BEFORE inserting your USB drive, run the | |
# following: | |
diskutil list | |
# This will output a bunch of info about all of the disk drives connected to | |
# your Mac. Each entry will have a header in the form "/dev/diskX", where X is | |
# some number starting at 0. Now, insert your USB drive and run the command | |
# again. You should see a new entry. Make note of the name (ie, /dev/diskX). | |
diskutil list |
# - Find Boost | |
# | |
# Copyright (c) 2016 Thiago Barroso Perrotta | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in | |
# the Software without restriction, including without limitation the rights to | |
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is furnished to do so, | |
# subject to the following conditions: |
# for gist naming purposes |
# according to http://jdfreder-notebook.readthedocs.org/en/docs/examples/Notebook/Importing%20Notebooks.html | |
import io, os, sys, types | |
from IPython import get_ipython | |
from IPython.nbformat import current | |
from IPython.core.interactiveshell import InteractiveShell | |
def find_notebook(fullname, path=None): | |
"""find a notebook, given its fully qualified name and an optional path | |
This turns "foo.bar" into "foo/bar.ipynb" |
Useful tip from the late creator of matplotlib, John Hunter.
http://matplotlib.1069221.n5.nabble.com/dynamically-add-subplots-to-figure-td23571.html
import matplotlib.pyplot as plt
# start with one
fig = plt.figure()
ax = fig.add_subplot(111)
This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.
To use the script, follow the instructions given in the script's docstring.
For further details, read this blogpost.
The procedure outlined here is inspired by this answer on Stack Overflow.
LightPink1 #ffbdc5 255 189 197 {65535 | 48573 | 50629} | |
---|---|---|---|
pink4 #9d777f 157 119 127 {40349 | 30583 | 32639} | |
pink3 #d7a3ad 215 163 173 {55255 | 41891 | 44461} | |
pink2 #f2b9c4 242 185 196 {62194 | 47545 | 50372} | |
pink1 #ffc3cf 255 195 207 {65535 | 50115 | 53199} | |
HotPink4 #9e4f75 158 79 117 {40606 | 20303 | 30069} | |
HotPink3 #d878a1 216 120 161 {55512 | 30840 | 41377} | |
HotPink2 #f383b5 243 131 181 {62451 | 33667 | 46517} | |
HotPink1 #ff87c1 255 135 193 {65535 | 34695 | 49601} | |
DeepPink4 #9e1e62 158 30 98 {40606 | 7710 | 25186} |