Skip to content

Instantly share code, notes, and snippets.

@robertour
robertour / bash_prompt.sh
Last active July 5, 2021 15:40 — forked from romanlevin/bash_prompt.sh
Set color bash prompt according to active pyenv, git branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@robertour
robertour / fetch_binder.js
Created August 28, 2019 07:19
creates a binder session on the background
fetch = function() {
// URL of the repository
var apiUrl = 'https://notebooks.gesis.org/binder/build/gh/gesiscss/smm_demo/master';
eventSource = new EventSource(apiUrl);
eventSource.onerror = function(err) {
console.error("Failed to construct event stream", err);
};
eventSource.addEventListener("message", function(event) {