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 varargout = process_something_raw_file( varargin ) | |
% PROCESS_SOMETHING_RAW_FILE: Do something on a raw file, create new raw file, add it to BST database. | |
% | |
% @============================================================================= | |
% This software is part of the Brainstorm software: | |
% http://neuroimage.usc.edu/brainstorm | |
% | |
% Copyright (c)2000-2023 Brainstorm by the University of Southern California | |
% This software is distributed under the terms of the GNU General Public License | |
% as published by the Free Software Foundation. Further details on the GPL |
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
% Script to run connectivity (magnitude square coherence) on data from the | |
% Corticomuscular coherence tutorial: | |
% https://neuroimage.usc.edu/brainstorm/Tutorials/CorticomuscularCoherence | |
% | |
% This is done in order to verify the difference approaches for PCA | |
% provided in the ScoutPca branch (by Marc) | |
%% Parameters | |
% Brainstorm version and Protocol | |
ProtocolName = 'TutorialCMC'; |
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
% Write empty FreeSurfer wfile | |
fileFullPath = '~/Desktop/dummy_rh.w'; | |
% Create binary big-endian file | |
fid = fopen(fileFullPath, 'wb', 'b'); | |
% Int16 for Latency | |
fwrite(fid, 0, 'int16'); | |
% Count of vertex-value pairs to follow (3-bytes) | |
fwrite(fid, [0, 0, 0], 'uchar') ; | |
% Close file | |
fclose(fid); |
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 "syntax-variables"; | |
atom-text-editor { | |
.syntax--diff { | |
&.syntax--inserted &.syntax--inserted.syntax--punctuation { | |
color: @syntax-color-added; | |
} | |
&.syntax--changed { | |
color: @syntax-color-modified; | |
} |
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
class Greeter(object): | |
def __init__(self): | |
print("Hi") | |
class PersonGreeter(Greeter): | |
def __init__(self, name): | |
super(PersonGreeter, self).__init__() | |
print(name) | |
``` |
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
# 1. Get all info | |
curl -s "https://api.github.com/repos/brainstorm-tools/brainstorm3/commits?per_page=1&sha=master" | |
# Parse sha | |
curl -s "https://api.github.com/repos/brainstorm-tools/brainstorm3/commits?per_page=1&sha=master" | grep -oP '(?<=^\s\s\s\s"sha":\s").*(?=")' | |
# 2. Get only sha | |
curl -s -H "Accept: application/vnd.github.sha" "https://api.github.com/repos/brainstorm-tools/brainstorm3/commits/master" |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Random colors for RGB LEDs | |
Random RGB (R=U[0,1), G=U[0,1), B=U[0,1)) can lead to dark and light colors | |
which may not be goal when picking a random color for a RGB LED | |
This shows how to pick a color in the HSV space (H=U[0,1), S=U[0.8,1), V=1]) | |
and convert it to RGB. Note that the Saturation is sampled such that colors |
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
#!/bin/bash | |
set -e # Stop execution of script if a command or pipeline has an error | |
printf '\nExample post-checkout hook\n' | |
# These are the parameters given to the hook | |
# https://git-scm.com/docs/githooks.html#_post_checkout | |
oldHEAD=$1 # ref of the previous (old) HEAD | |
newHEAD=$2 # ref of the new HEAD | |
checkoutType=$3 # checkout type flag: 1 = changing branches, |
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 numpy as np | |
# How NOT to do it!!! | |
x = np.zeros([2,2]) # NumPy array, is mutable | |
print(id(x)) # ID for x | |
a = x # a is not a copy of x, it is the same variable in memory | |
print(id(a)) # ID of a == ID of x | |
x[0,0] = 1 # Updating values in x | |
b = x # b is not a copy of x, it is the same variable in memory | |
print(id(a)) # ID of a == ID of x |
NewerOlder