Skip to content

Instantly share code, notes, and snippets.

View iandol's full-sized avatar
👾
typing away...

Ian Max Andolina iandol

👾
typing away...
  • Institute of Neuroscience, Chinese Academy of Sciences
  • Shanghai
  • 17:15 (UTC +08:00)
View GitHub Profile
@iandol
iandol / 90-ptbxorg.conf
Created November 24, 2020 01:04
Standard PTB xorg.conf.d file, for a 10bit VRR Aorus monitor, this file should be in /etc/X11/xorg.conf.d/
# Auto generated xorg.conf - Created by Psychtoolbox XOrgConfCreator.
Section "ServerLayout"
Identifier "PTB-Hydra"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" LeftOf "Screen0"
EndSection
Section "Monitor"
Identifier "DisplayPort-0"
[
{
"DOI": "10.1146/annurev-vision-030320-062352",
"author": [
{
"family": "Mathôt",
"given": "S"
}
],
"container-title": "Annual review of vision science",
@iandol
iandol / BibTeX-Minimal.fmt
Created September 21, 2020 07:51
For Bookends: slightly modified BibTeX export format that removes the abstract and address fields to make a faster and smaller BibTeX export…
{"16":{"author1Popup":0,"author1PopupForCitation":0,"authorSubsequentPopup":0,"authorSubsequentPopupForCitation":0,"authorsInCapsBox":"100","authorsInCapsBoxForCitation":"0","editor1Popup":0,"editor1PopupForCitation":0,"editorSubsequentPopup":0,"editorSubsequentPopupForCitation":0,"etalString":" et al.","etalString1":" et al.","forCitationForCitation":1,"id":7,"idForCitation":1,"nameFormPopup":1,"nameFormPopupForCitation":0,"notes":"Key (id) values belong in Key field (AKA User1)","notesForCitation":"","order1":"{\\rtf1\\ansi\\ansicpg1252{\\fonttbl{\\f0\\fnil Arial;}}{\\colortbl\\red0\\green0\\blue0;}\\uc0 \\f0\\fs24 `@electronic\\{`u1`,`$\\par author = $`\\{`a`\\}`, $\\par title = $`\\{`t`\\}`, $\\par url = $`\\{`z`\\}`, $\\par journal = $`\\{`j`\\}`, $\\par year = $`\\{`d`\\}`,\\par `keywords = \\{`k`\\}\\}`\\u172\\par }","order1ForCitation":"","order2ForCitation":"","otherNames":0,"otherNamesCitation":0,"punctAfterInit":"","punctAfterInitForCitation":"","punctAfterSurname":"","punctAfterSurnameForCitation"
@iandol
iandol / config.json
Last active October 13, 2022 20:06
V2Ray setup, adds HTTP and SOCKS proxy and more logging (see https://www.v2ray.com/en/configuration/index.html). Another option is to use clash to provide a HTTP to SOCKS proxy https://github.com/Dreamacro/clash
{
"log": {
"logelevel": "info"
},
// Run a local SOCKS proxy for apps to connect to.
"inbounds": [{
"port": 1080,
"listen": "127.0.0.1",
"protocol": "socks",
"sniffing": {
@iandol
iandol / loadEEGData.m
Last active April 26, 2020 03:15
Load EDF data with 8 trigger channels
ft_defaults;
fileName = 'Test_4.edf';
bitchannels = 3:10;
cfg = [];
cfg.dataset = fileName;
cfg.header = ft_read_header(cfg.dataset);
labels = cfg.header.label(3:end);
data_events = ft_read_event(cfg.dataset,'header',cfg.header,...
'detectflank','up','chanindx',bitchannels,'threshold','5*nanmedian');
events = [];
@iandol
iandol / first-run-OK-second-run-FAIL.log
Last active February 22, 2020 08:18
Ubuntu 19.10, PTB 3.0.16, NVidia RTX 2070 435.26 driver (from Ubuntu, not NVidia)
>> Screen('Preference', 'Verbosity', 10);VBLSyncTest
ans =
0
PTB-INFO: Gamemode optimizations enable requested. Current/Old status: Disabled
PTB-INFO: New status: Active
ans =
@iandol
iandol / mex_C_glnxa64.xml
Created January 9, 2020 11:10
Compiler configuration in MATLAB 2019b
<?xml version="1.0" encoding="utf-8"?>
<config Name="gcc" ShortName="gcc" Manufacturer="GNU" Version="$VER" Language="C" Priority="A" Location="$GCC">
<Details CompilerExecutable="$CC" CompilerDefines="$DEFINES" CompilerFlags="$CFLAGS" OptimizationFlags="$COPTIMFLAGS" DebugFlags="$CDEBUGFLAGS" IncludeFlags="$INCLUDE" LinkerLibraries="$LINKLIBS" LinkerOptimizationFlags="$LDOPTIMFLAGS" LinkerDebugFlags="$LDDEBUGFLAGS" CompilerDefineFormatter="-D%s" LinkerLibrarySwitchFormatter="-l%s" LinkerPathFormatter="-L%s"/>
<vars CMDLINE1="$CC -c $DEFINES $INCLUDE $CFLAGS $OPTIM $SRC -o $OBJ" CMDLINE2="$LD $LDFLAGS $LDTYPE $LINKOPTIM $LINKEXPORTVER $OBJS $CLIBS $LINKLIBS -o $EXE" CC="$GCC" DEFINES="-D_GNU_SOURCE $MATLABMEX" MATLABMEX="-DMATLAB_MEX_FILE " CFLAGS="-std=c++11 -fexceptions -fPIC -fno-omit-frame-pointer -pthread" INCLUDE="-I&quot;$MATLABROOT/extern/include&quot; -I&quot;$MATLABROOT/simulink/include&quot;" COPTIMFLAGS="-O2 -fwrapv -DNDEBUG" CDEBUGFLAGS="-g" LD="$CC" LDFLAGS="-pthread -Wl,--no-undefined -Wl,-rp
@iandol
iandol / VBLSyncTest Verbosity 10 NO ConserveVRAM set
Last active October 29, 2019 02:19
VBLSyncTest Verbosity 10 log, macOS 10.15,
>> clear screen; sca
PTB-DEBUG: IOServiceClose() for driver instance 0 was successfull.
PTB-INFO: Activity state of AppNap is: Activities selected by PTB.
PTB-INFO: Reenabling AppNap et al. ... Make it so! 0x600005b17c00 - Retain 1
======== Screen() for evaluation of macOS visual presentation timing fix ========
======== For evaluation by the Pelli lab and collaborators only! ========
======== Functionally limited to drawing of simple FillRect and DrawLine ========
@iandol
iandol / colorgrating.frag
Last active August 24, 2019 13:14
Colour Grating Shader, go to http://editor.thebookofshaders.com and paste code this in. Or go to http://glslsandbox.com/e#56894.0
//red-green sinusoidal grating
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
float contrast = 0.75;
vec3 colorA = vec3(1.0,0.0,0.0);//red
@iandol
iandol / movietest.m
Last active August 21, 2019 06:45
Trying to get non-flickering, non-blocking movie playback on PTB, the trick is to use non-blocking double buffering, keep showing the old frame until a new frame is available. Otherwise if you block, you miss flips waiting for the correct time, and if you don't block, then you get blank frames if you flip at FPS.
function movietest()
bgColour = 0.5;
screen = max(Screen('Screens'));
screenSize = [];
ptb = mySetup(screen,bgColour,screenSize);
filename='C:\Code\opticka\stimuli\monkey.mp4';
preloadsecs = [];