This file contains 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 re | |
import sys | |
if len(sys.argv)<3: | |
print "Need an input filename (i.e., du -sh > input.txt) and a csv output filename" | |
sys.exit(1) | |
# pass a file with du -h output as the first command line argument | |
with open(sys.argv[1]) as f: | |
lines = [x.strip() for x in f.readlines()] |
This file contains 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
; Register Style Plugin directory | |
plugins[panels][styles] = panels/styles |
This file contains 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
<?php | |
// make an svg given an initial stripe color, initial stripe height, other stripe height, and total overall height | |
$osh = $_GET['oh']; // stripe height | |
$h = $_GET['h']; // overall height | |
$isc = (isset($_GET['c']))? $_GET['c']:""; // optional initial stripe | |
$ish = (isset($_GET['ch']))? $_GET['ch']:0; // height of initial stripe | |
$offset = (isset($_GET['offset']))? $_GET['offset']:0; // "offset" (actually just the height of the first stripe) | |
$altcolors = array("#ededeb", "#e4e4e3"); |
This file contains 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 csvhwrite(fn, data, hdr) | |
% function csvhwrite(fn, data, hdr) | |
% write a csv file with cell array hdr (cols in data must match length of hdr) | |
if isempty(fn) | |
fn = spm_input('Filename: ', '+1', 's'); | |
end | |
if size(data,2)~=length(hdr) | |
error('Header length does not match data'); |
This file contains 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 outputStuff = mfcsvread(fileName) | |
%mfcsvread reads a CSV file containing both text & numeric data. MATLAB's | |
%csvread function will work with all numeric, or all text data, but not | |
%both. It's common to have a file with a single line of comma separated | |
%text headers followed by many rows of numeric data. xlsread is limited in | |
%the number of rows & colums (actually, Excel is the limitation) it can | |
%read. | |
% | |
% The CSV file should look like: | |
% comma, separated, text, ... |
This file contains 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
# construct spaghetti plots in R | |
# skip to the last few lines for the actual ggplot definition | |
# | |
# melt to long format | |
# in this case, we have subjects with a dv collected | |
# 1) at multiple timepoints (wave) | |
# 2) in multiple brain regions (region) | |
# subjects also have an age, which helps make a prettier spaghetti plot | |
require(reshape2) | |
long_data <- melt(wide_data, id.vars=c("ID", "wave", "age")) |
This file contains 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
# source me and then use: | |
# | |
# splitfile("workbook.xlsx", 1) | |
# | |
# to extract sheet 1 from workbook.xlsx | |
# set these if they vary | |
# subj_col determines the name of the output file | |
subj_col <- 1 | |
# content_col determines the column with the contents of the file |
This file contains 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
-- Usage: <script> gatewayHostName username password | |
-- based on https://gist.github.com/andrewh/7135352 and https://github.com/seanfisk/juniper-network-connect-vpn-applescript/blob/master/juniper.applescript | |
on run argv | |
if (count of argv) is not equal to 3 then | |
return "Usage: <script> gatewayHostName username password" | |
else | |
set {gatewayHostName, username, pw} to argv | |
This file contains 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
--- | |
# 5.1 compile from source from https://sonnguyen.ws/install-mysql-5-1-ubuntu-14/ and trial and error | |
- stat: path=/usr/bin/mysqld_safe | |
register: mysql_binary | |
- name: Install build tools | |
sudo: yes | |
apt: name={{item}} state=installed | |
with_items: |
This file contains 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
diff --git a/README.txt b/README.txt | |
old mode 100755 | |
new mode 100644 | |
index d2bdcba..27e73b6 | |
--- a/README.txt | |
+++ b/README.txt | |
@@ -39,8 +39,7 @@ ourselves. | |
REQUIREMENTS | |
OlderNewer