Skip to content

Instantly share code, notes, and snippets.

@kastman
kastman / bash output
Created February 29, 2012 20:31
Psychopy Nested Loops Psydat Overwrite Bug
$ ls data/
_2012_Feb_29_1520.log _2012_Feb_29_1520inner_trials.psydat
_2012_Feb_29_1520.xlsx _2012_Feb_29_1520trials.psydat
# Notice only one inner_trials psydat.
@kastman
kastman / nrg_interfaces.py
Created September 7, 2012 16:19
HVD NRG Nipype Interface to QA
#!/usr/bin/env python
from nipype.interfaces.base import BaseInterface, BaseInterfaceInputSpec, TraitedSpec, traits, InputMultiPath, OutputMultiPath, File
from nipype.utils.filemanip import split_filename
import niftiqa
import os, sys
####### Begin Class niftiqa ########
class niftiqaInputSpec(BaseInterfaceInputSpec):
niftis = InputMultiPath(traits.Either(traits.List(File(exists=True)),File(exists=True)),
@kastman
kastman / new.html.erb
Created January 14, 2014 21:02
Really Simple Contact Form View
<div class="row">
<div class="col-md-12">
<div class="page-header">
<h1>Contact Us</h1>
</div>
<p>We can help you answer questions and solve problems. Fill out the following form and we'll be in touch shortly:</p>
</div>
<div class="row">
<div class="col-md-12 well">
<div class="col-md-3 col-md-offset-1" id='contact-form'>
@kastman
kastman / README.md
Last active August 29, 2015 13:59
Clean Survana Install

Install Instructions

Prerequisites

  • Install Homebrew
  • ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install node.js:
  • Note: The only current supported version is node 0.8 (0.10 breaks with some charset error).
  • brew install nvm
  • Note: Homebrew requires some setup for node, including mkdir ~/.nvm and adding NVM_DIR and sourcing nvm.sh to the .bash_profile. Follow the instructions under "==> Caveats" if you see them.
@kastman
kastman / 7-1-2014
Created July 17, 2014 16:17
GET form_vars trace
An ArgumentError occurred in contacts#new:
invalid %-encoding (arizona10U
scottsdale1%0#U
starfield technologies, inc.1301U *http://certs.starfieldtech.com/repository/1402U +starfield secure certificate authority - g2- g3l-)
vendor/ruby-1.9.2/lib/ruby/1.9.1/uri/common.rb:765:in `decode_www_form_component'
-------------------------------
Request:
@kastman
kastman / recon_script.sh
Last active April 29, 2016 21:41
Simple FAL Freesurfer Runner using dcmstack and ArcGet
#!/usr/bin/env bash
load_freesurfer 5.3.0-centos4
export SUBJECTS_DIR=/ncf/jwb/studies/FallyMGH/Analyses/fsrecon_v1
export L1SINK=/ncf/jwb/studies/FallyMGH/Analyses/fmriNipype_v1/data/level1sink/
batch1=(FAL001 FAL002 FAL004 FAL009 FAL009 FAL010)
batch2=(FAL010 FAL013 FAL014 FAL020 FAL021 FAL024 FAL025 FAL026 FAL029)
for subj in "${batch2[@]}"; do
@kastman
kastman / README.md
Last active August 29, 2015 14:14
Clean Survana Install (for exporting only)

Install Survana for Exporting Responses

Prerequisites

  • Install Homebrew
  • ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Install node.js:
  • Note: The only current supported version is node 0.8 (0.10 breaks with some charset error).
@kastman
kastman / fir_snippet.py
Created February 4, 2015 03:45
FIR or Standard Onset Creator Snippet
def _build_betacourse_regressors(self, timings, condition_code, durations_list=[]):
onsets=[];durations=[];conditions=[]
print timings.size, len(durations_list)
for i in range(timings.size):
onset = [timings[i]]
duration = [durations_list[i]] if len(durations_list) else [2]
name = "%s_%d" % (condition_code, i + 1)
onsets.append(onset)
durations.append(duration)
conditions.append(name)
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.81.03), Mon Mar 16 17:19:06 2015
If you publish work using this script please cite the relevant PsychoPy publications
Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neuroscience Methods, 162(1-2), 8-13.
Peirce, JW (2009) Generating stimuli for neuroscience using PsychoPy. Frontiers in Neuroinformatics, 2:10. doi: 10.3389/neuro.11.010.2008
"""
from __future__ import division # so that 1/3=0.333 instead of 1/3=0
@kastman
kastman / gist:68f2fa98419566e8158ab385bc89ae04
Last active March 6, 2018 18:50
Failing CircleCI Build
$ circleci build
====>> Spin up Environment
Build-agent version 0.0.4710-44beb0a (2018-02-27T20:05:34+0000)
Starting container bioconda/bioconda-utils-build-env
using image bioconda/bioconda-utils-build-env@sha256:1754002c070d602a3f80d4cb029129081d88487c97026a279b873b003d48bdb8
Using build environment variables:
BASH_ENV=/tmp/.bash_env-localbuild-1520100701
CI=true