Skip to content

Instantly share code, notes, and snippets.

View JohnAtl's full-sized avatar

John T. Johnson JohnAtl

View GitHub Profile
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm with Anaconda plugin .app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/Applications/PyCharm with Anaconda plugin .app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/Users/john/PycharmProjects/mne-test/mne-test.py", line 16, in <module>
ica.plot_properties(raw, picks=ica.exclude)
File "/Users/john/PycharmProjects/mne-test/venv/lib/python3.7/site-packages/mne/preprocessing/ica.py", line 1633, in plot_properties
figsize=figsize, show=show, reject=reject)
%
% Insert events based on transitions on a high-level input channel.
%
% As with all code from the internet, verify that it works for your unique situation.
%
function EEG = hl1_to_events(EEG)
% Find the index of the high-level (trigger) channel.
hl1_index = eeg_chaninds(EEG, 'HL1');
hl1 = EEG.data(hl1_index,:);
@JohnAtl
JohnAtl / insert_filename_as_header.rb
Created February 7, 2020 20:25
Code to help with note-link-janitor
#!/usr/bin/ruby
#
# Inserts the file's name as the first header in the file, if it isn't already there.
# Assumes filename begins with a 14 digit zettelkasten ID.
# Original file saved as filename.bak.
#
# As always, caveat emptor. This code could harm your files, so try it on a backup.
#
Dir.glob('*.md') do |filename|
puts "working on: #{filename}"