Skip to content

Instantly share code, notes, and snippets.

#Uploaded in response to query on psychopy list: https://groups.google.com/group/psychopy-users/browse_thread/thread/c65e453edf530f8
#asking for code to input a string.
#Program flashes string on screen, and user tries to type it in. Supports backspace but no other editing special characters.
#Checks whether subject got it right
#Alex Holcombe [email protected] 21 August 2012
#licensing: CC-BY whch means do whatever you want with it, with an attribution to the author. If you want permission to use it without
#attribution, just contact me.
from psychopy import monitors, visual, event, data, logging, core, sound, gui
import psychopy.info
@luyanji-psy
luyanji-psy / filterArray.js
Created July 2, 2020 13:49 — forked from jherax/arrayFilterFactory.1.ts
Filters an array of objects with multiple match-criteria.
/**
* Filters an array of objects using custom predicates.
*
* @param {Array} array: the array to filter
* @param {Object} filters: an object with the filter criteria
* @return {Array}
*/
function filterArray(array, filters) {
const filterKeys = Object.keys(filters);
return array.filter(item => {