Skip to content

Instantly share code, notes, and snippets.

View sgibson91's full-sized avatar

Sarah Gibson sgibson91

View GitHub Profile

Keybase proof

I hereby claim:

  • I am sgibson91 on github.
  • I am sgibson91 (https://keybase.io/sgibson91) on keybase.
  • I have a public key ASClNUl5_KdFZcPTgdkcHpalqaYowsAKun5chsAh7ybgUQo

To claim this, I am signing this object:

@sgibson91
sgibson91 / logo.html
Created November 28, 2019 21:00
Changing Binder logo
<img id="logo" src={% block logo_image %}"/extra_static/IMAGE_NAME"{% endblock logo_image %} width="390px" />
@sgibson91
sgibson91 / clusterissuer.yaml
Created November 28, 2019 21:08
cert-manager cluster issuer config file
---
apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
name: prod
labels:
helm.sh/chart: {{ include "hub23-chart.chart" . }}
app.kubernetes.io/name: {{ include "hub23-chart.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
@sgibson91
sgibson91 / user-configmap.yaml
Created November 28, 2019 21:09
cert-manager user-configmap file
kind: ConfigMap
apiVersion: v1
metadata:
name: user-etc-jupyter
labels:
app: jupyterhub
component: etc-jupyter
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
@sgibson91
sgibson91 / _helper.tpl
Created November 28, 2019 21:10
cert-manager helpers file
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "hub23-chart.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
@sgibson91
sgibson91 / login.html
Created November 28, 2019 21:11
Login template
{% extends "templates/login.html" %}
{% block site %}
<div id="ipython-main-app" class="container">
<h1>Binder inaccessible</h1>
<h2>
You can get a new Binder for this repo by clicking <a href="{{binder_url}}">here</a>.
</h2>
<p>
The shareable URL for this repo is: <tt>{{binder_url}}</tt>
{% extends "templates/page.html" %}
{% block login_widget %}{% endblock %}
@sgibson91
sgibson91 / choose_competition_winner.py
Created April 1, 2020 18:10
A python script to generate a competition winner from an input file of entries (one entry per line)
#!/usr/bin/env python
import argparse
import numpy as np
def parse_args():
"""Construct the command line arguments
Returns:
args -- Parsed arguments
@sgibson91
sgibson91 / update_pr_base.py
Last active June 25, 2020 21:17
Use the GitHub API to update the base branch of open Pull Requests
"""
Script to pull a list of open Pull Requests for a GitHub repository and change
the base branch using the GitHub API. For this script to run successfully, you
must have write access to the target repository. If the repository belongs to
an organisation, then you must be a member of that organisation with write
access.
This script requires a GitHub Personal Access Token. To update Pull Requests in
public repos, the token only needs the `public_repo` scope. To update Pull
Requests in private repos, the token needs the full `repo` scope.
#!/bin/bash
# Get this script's path
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
# Read config.json and get BinderHub name
configFile="${DIR}/config.json"
AKS_RESOURCE_GROUP=$(jq -r '.azure .res_grp_name' "${configFile}")
RESOURCE_GROUP_LOCATION=$(jq -r '.azure .location' "${configFile}")
BINDERHUB_NAME=$(jq -r '.binderhub .name' "${configFile}")