Skip to content

Instantly share code, notes, and snippets.

@isaac-ped
isaac-ped / if_not_disabled.c
Last active February 15, 2018 18:27
Macro fanciness for detecting disabled feature
#include <stdio.h>
#define STRINGIFY(X) "" #X
#define STRINGIFY2(X) STRINGIFY(X)
#define IF_NOT_DISABLED(ID, FN, ...) \
(!strcmp("DISABLE_" #ID, STRINGIFY2(DISABLE_##ID))) ? FN(ID, ##__VA_ARGS__) : 0
enum my_enum {
FOO,
@isaac-ped
isaac-ped / launch.scpt
Created October 24, 2017 21:34
Launch split iTerm windows
on readFile( unixPath )
return (do shell script "cat '" & unixPath & "'")
end
on getSess(sessions_, names, name)
repeat with i from 1 to count of names
repeat with j from 1 to count of (item i of names)
if item j of (item i of names) equals name
return item j of (item i of sessions_)
end if
@isaac-ped
isaac-ped / RAMControl.m
Last active February 2, 2016 16:30 — forked from anonymous/cbmex.cpp
function loop(this, hObject, statusCallback, exitCallback)
% Main loop - acquire samples and call analysis functions
% Get handles used below
stimControl = StimControl.getInstance(); % Singleton instance to analyis code
% This starts data zooming through the buffer. Set an onCleanup handler in case of error
% so that data acquisition can be stopped prior to releasing MATLAB memory used by cbmex.
this.setupTrialConfigMemory();