Skip to content

Instantly share code, notes, and snippets.

@branning
branning / onEditHighlight.js
Created February 11, 2019 05:17
Google Sheets set cell background color based on named range background color
var stages = SpreadsheetApp.getActiveSpreadsheet().getRangeByName("Stages")
function onEdit(e) {//"e" receives the event object
var range = e.range;//The range of cells edited
var value = e.value;//the new value in the cell
var columnOfCellEdited = range.getColumn();//Get column number
if (columnOfCellEdited !== 1) {
return;
@branning
branning / winswitch_01trillian.md
Last active October 31, 2016 17:05
Use Winswitch to run Trillian remotely on Ubuntu and view locally on MacOS

Use Winswitch to run Trillian remotely on Ubuntu 14.04 and view locally on MacOS

Winswitch is like 'screen for X11', in that it allows you to start an application on a remote host, connect to it remotely, disconnect, and re-connect later and everything will be as you left it. It decouples the viewing of a graphical application from the running of it.

You can achieve a similar effect with X11 forwarding in ssh, by using ssh -Y <hostname> <application>, but when you disconnect the application will quit.

The connection itself is made with Xpra, which is like VNC but allows more efficient video and audio compression.

Install Trillian on remote server

@branning
branning / miniconda_install.sh
Last active February 20, 2018 15:10
Install miniconda3 64-bit
#!/bin/bash
#
# Install conda
# modified from https://github.com/blaze/odo/blob/master/.travis.yml
miniconda_home=$HOME/miniconda
case $OSTYPE in
linux*) OS='Linux';;
darwin*) OS='MacOSX';;
mysys*|cygwin) OS='Windows';;
@branning
branning / live_hosts.sh
Created August 29, 2016 00:19
Find live hosts on local network with nmap
#!/bin/bash
#
# Find live hosts on local network with nmap
quiet() { $@ >/dev/null 2>&1; }
error() { echo 2>&1 "$@"; }
if ! quiet command -v nmap
then
error "You must install nmap."
#!/bin/bash
#
# alias for npm that only uses git over https
set -o errexit # exit on any error
real_npm=`which npm`
npm_install()
{
#!/usr/bin/env bats
#
# Bash Automated Testing System (BATS)
# https://github.com/sstephenson/bats
#
# Test curltail, both sourced and executed
@test "Missing argument, sourced" {
. curltail.sh
run curltail
@branning
branning / install_debian_jupyter_2_and_3.sh
Last active October 27, 2017 15:09
Run Python 2 & 3 in Jupyter on Fedora Linux
#!/bin/bash
#
# Install Jupyter Notebook with Python 2 and Python 3 kernels on Debian
# from http://stackoverflow.com/a/34421527/347567
set -o errexit
# As root, install `pip` and `jupyter` from apt, and the development packages, too.
apt-get update
apt-get install -y \
@branning
branning / matplotlib_jupyterlite_loop.ipynb
Last active October 22, 2023 23:25
Matplotlib nbagg example that updates in a loop
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@branning
branning / environment.yml
Created December 14, 2015 15:32
Installing Scipy in Virtualenv, SO 34255582
name: scipy
dependencies:
- numpy=1.10.1=py27_0
- openssl=1.0.2d=0
- pip=7.1.2=py27_0
- python=2.7.11=0
- readline=6.2=2
- scipy=0.16.0=np110py27_1
- setuptools=18.5=py27_0
- sqlite=3.8.4.1=1
@branning
branning / Dockerfile
Created June 18, 2015 23:56
bootstrap a new Rails app in Docker from boot2docker
FROM rails:onbuild