Skip to content

Instantly share code, notes, and snippets.

View wjhopper's full-sized avatar

Will Hopper wjhopper

View GitHub Profile
function exit_stat = DrawLeftArrowToOffScreenDemo()
exit_stat = 0;
PsychDefaultSetup(2); % assert OpenGL install, unify keys, fix color range
screenNumber = max(Screen('Screens')); % Choose a monitor to display on
[window, winRect] = Screen('OpenWindow', screenNumber, ...
(2/3)*WhiteIndex(screenNumber));
arrowTexture = makeLeftArrowTex(screenNumber, winRect(3)/2, winRect(4)/2, winRect(3)/2 - 100, winRect(4)/2);
library(ggplot2)
library(dplyr)
library(tidyr)
library(stringr)
library(scales)
library(gridExtra)
library(grid)
# use the NPR story data file ---------------------------------------------
# and be kind to NPR's bandwidth budget
@olberger
olberger / shibb-cas-get.sh
Created December 4, 2014 09:59
Connection to a web app protected via Shibboleth with curl
#!/bin/sh
#set -x
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST=https://myapp.example.com/
SP=https://myapp.example.com/index.php
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok"
@vasishth
vasishth / blups.R
Created March 15, 2013 20:46
BLUPs
> # Calculate the predicted random effects by hand for the ergoStool data
> (fm1<-lmer(effort~Type-1 + (1|Subject),ergoStool))
Linear mixed model fit by REML
Formula: effort ~ Type - 1 + (1 | Subject)
Data: ergoStool
AIC BIC logLik deviance REMLdev
133 143 -60.6 122 121
Random effects:
Groups Name Variance Std.Dev.
Subject (Intercept) 1.78 1.33
@nschneid
nschneid / zotselect-link.js
Last active January 15, 2024 02:56
Zotero export translator that generates a zotero://select link to an item in the Zotero library. (First a simple version, as well as a version that displays minimal citation information and stores further details as title text.)