This file contains 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
version: '3' | |
services: | |
jupyter: | |
container_name: my_jupyter | |
#image: jupyter/datascience-notebook | |
image: jupyter/minimal-notebook | |
ports: | |
- '127.0.0.1:8888:8888' | |
environment: |
This file contains 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
## Initial setup you should only have to do this once | |
# Checkout docker stacks project | |
git clone https://github.com/jupyter/docker-stacks | |
cd docker-stacks/base-notebook | |
# Clone the telemetry in this directory, this is currently a private repo. | |
git clone https://github.com/educational-technology-collective/hwf-jupyterlab-telemetry | |
# git needs to be added to base image |
This file contains 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
jupyter: | |
image: jupyter/datascience-notebook | |
environment: | |
- PASSWORD=${PASSWORD} | |
nginx: | |
image: nginx | |
links: | |
- jupyter |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
# -*- coding: utf-8 -*- | |
import functools | |
from django.contrib.admin import ModelAdmin | |
from django.contrib.admin.options import InlineModelAdmin | |
from django.contrib.admin.utils import flatten_fieldsets | |
from django.core.exceptions import ObjectDoesNotExist | |
from django.db.models import OneToOneField, ForeignKey | |
from django.forms import ModelForm | |
from django.forms.models import BaseModelFormSet, modelformset_factory |
This file contains 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 recursiveFormat(args, **kwargs): | |
""" | |
Recursively apply `string.format()` to all strings in a data structure. | |
This is intended to be used on a data structure that may contain | |
format strings just before it is passed to `json.dump()` or `dumps()`. | |
Ideally, I'd like to build this into a subclass of `json.JsonEncoder`, | |
but it's tricky to separate out string handling in that class. I'll | |
continue to think about it. |
This file contains 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/sh -- | |
# Get the local ngrok public URL, which includes the hostname, extracted using jq | |
# Inspiration: https://gist.github.com/rjz/af40158c529d7c407420fc0de490758b#gistcomment-2594627 | |
curl --silent http://127.0.0.1:4040/api/tunnels | jq -r '.tunnels[0].public_url' |
This file contains 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
1. Substitute the NaN's in a dataframe with values from another dataframe | |
If you have two DataFrames of the same shape, then: | |
df[df.isnull()] = d2 | |
2.Replace values in a dataframe with values from another dataframe by conditions |