Skip to content

Instantly share code, notes, and snippets.

View ChrisCooper's full-sized avatar

Chris Cooper ChrisCooper

  • Toronto
View GitHub Profile
@ChrisCooper
ChrisCooper / new_ssh_machine.sh
Created May 17, 2021 00:36
Setup SSH for new Ubuntu 20.04 machine
# print commands
set -x
sudo apt-get update
sudo apt-get upgrade -y
sudo apt install -y git net-tools tmux tree vim
# Install SSH sever
sudo apt install -y ssh openssh-server
  1. Drag this link into your bookmarks bar: [Flexible search CSV export bookmarklet](javascript:function addCsvDownloadLink(){console.log("Adding download link"),$("#queryResultTable_length").append(' <a id="csvDownloadLink" href="#" class="export">Download as CSV</a>'),console.log("Modifying link behaviour"),$("#csvDownloadLink").click(function(){var n=$("#queryResultTable"),o=exportTableToCsvString(n),t="data:application/csv;charset=utf-8,"+encodeURIComponent(o);$(this).attr({download:"flexibleSearch.csv",href:t,target:"_blank"})}),console.log("CSV ready for download")}function exportTableToCsvString(n){var o=tableToData(n);return dataToCsvString(o)}function tableToData(n){var o=n.find("thead").find("tr"),t=n.find("tbody").find("tr"),a=o.map(trRowToArray).get(),r=t.map(trRowToArray).get();return r.unshift(a[0]),r}function trRowToArray(n,o)
@ChrisCooper
ChrisCooper / bayesian_integration.py
Created October 20, 2012 10:18
Part of an assignment for a computational neuroscience class
#python 2.7
#Bayesian integration of information assignment
#Chris Cooper
from scipy.stats import norm
#observed
firing_rates = [40.8084, 44.3164, 34.1953, 75.3335, 43.4339,
50.6627, 49.4592, 47.3496, 38.5744, 14.938]