This file contains hidden or 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
function createDefaultRoles() { | |
defaultRoles = ['admin', 'researcher']; | |
defaultRoles.forEach(function(roleName) { | |
if (!Meteor.roles.findOne({ | |
name: roleName | |
})) { | |
Roles.createRole(roleName); | |
} | |
}); | |
} |
This file contains hidden or 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
Accounts.onLogin(function (users) { | |
/* if there's only one user, add that user to admin group */ | |
if (Meteor.users.find().count() === 1) { | |
Roles.addUsersToRoles(users.user._id, ['admin']); | |
} | |
}); |
This file contains hidden or 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
function remindToFloss() { | |
var ss = SpreadsheetApp.openById("INSERT SHEET ID HERE"); | |
var responses = ss.getSheets()[0].getDataRange(); | |
var participants = ss.getSheets()[1].getDataRange(); | |
var needsNotifying = []; | |
// Compile a list of email addresses that may need notifications | |
for (var i = 0; i <= participants.getNumRows() - 1; i++) { | |
var email = participants.getValues()[i][0]; |
This file contains hidden or 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 | |
mkdir -p client/compatibility client/styles client/lib client/views client/views/common lib server/lib public/images public/fonts .meteor | |
echo "local" > .meteor/gitignore | |
echo "meteor-platform\nautopublish\ninsecure\naccounts-base" > .meteor/packages | |
echo "[email protected]" > .meteor/release | |
echo "Router.configure({layoutTemplate: 'layout'}); Router.map(function() {this.route('home', {path: '/', template: 'home'});});" > client/routes.js | |
echo "<head><title>My App</title><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"></head><body></body><template name=\"layout\">{{>navbar}}<div class=\"container-fluid\">{{>yield}} </div></template>" > client/views/common/layout.html | |
echo "<template name=\"navbar\"><nav class=\"navbar navbar-default\" role=\"navigation\"><div class=\"container-fluid\"><div class=\"navbar-header\"><button type=\"button\" class=\"navbar-toggle\" data-toggle=\"collapse\" data-target=\"\#bs-example-navbar- |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://simplewebrtc.com/latest.js"></script> | |
</head> | |
<body> | |
<video height="300" id="localVideo"></video> | |
<div id="remotesVideos"></div> | |
<script> | |
var webrtc = new SimpleWebRTC({ |
This file contains hidden or 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 | |
# To get an Ubuntu 16.04 XFCE desktop: sudo sh -e ~/Downloads/crouton -t xfce,cli-extra,xiwi,extension -r xenial | |
# For CLI-only: sudo sh -e ~/Downloads/crouton -t cli-extra -r xenial | |
# To run the latest version: | |
# curl https://gist.githubusercontent.com/bdunnette/75fdc4b15b9599cd5fdf/raw/setup-chroot.sh | sh | |
sudo apt-get install -y nano curl git language-pack-en build-essential software-properties-common | |
sudo echo "deb http://cran.rstudio.com/bin/linux/ubuntu xenial/" | sudo tee -a /etc/apt/sources.list | |
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9 | |
gpg -a --export E084DAB9 | sudo apt-key add - | |
sudo apt-get update |
This file contains hidden or 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
ssh [email protected] | |
sudo su - swadm | |
sudo su - mysql | |
mysql -u root -p | |
CREATE USER 'olab'@'localhost' IDENTIFIED BY 'my_olab_database_password'; | |
GRANT ALL PRIVILEGES ON olab.* TO 'olab'@'localhost'; | |
OAuth callback URL: http://my-virtual-host.oit.umn.edu/home/loginOAuthCallback |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
A constant-space parser for the GeneOntology OBO v1.2 format | |
Modified from work by Uli Koehler: http://techoverflow.net/blog/2013/11/18/a-geneontology-obo-v1.2-parser-in-python/ | |
""" | |
from __future__ import with_statement | |
from collections import defaultdict | |
import types |
This file contains hidden or 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/bash | |
for s in *.svs | |
do | |
echo "$s" | |
#To generate a reasonable-sized JPEG, we'll export level 1 of the SVS file (level 0 = full magnification, which many image processing programs don't handle well) | |
time vips jpegsave $s[level=1] $s.jpeg | |
done |
This file contains hidden or 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
import sys | |
import gspread | |
import requests | |
cases = requests.get("http://slides.pathology.umn.edu/ISP/cases.json").json() | |
# Login with your Google account | |
gc = gspread.login(sys.argv[1], sys.argv[2]) | |
# Open a worksheet from spreadsheet with one shot |