Skip to content

Instantly share code, notes, and snippets.

View schluppeck's full-sized avatar

Denis Schluppeck schluppeck

View GitHub Profile
@schluppeck
schluppeck / index.html
Created December 5, 2018 20:23
simple p5.js sketch
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>p5.js example</title>
<style> body {padding: 0; margin: 0;} </style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.7.2/p5.js"></script>
<!-- <script src="../addons/p5.dom.min.js"></script> !-->
<script src="sketch.js"></script>
@schluppeck
schluppeck / _Index.md
Last active October 11, 2018 12:10
Understanding error messages and problems in PCN Neuroimaging lab (UoN)

FSL

What's gone wrong with my command line call?

Weird error message about "libc++abi.dylib: terminating with uncaught exception..."

no -i flag

  • problem: you forgot the -i flag before the input
  • fix: make sure you call with the -i flag:
%% minimal FFT2 example - for illustrating k-space
%
% ds 2018-10-05 (for the MSc Brain Imaging students)
% download a photo from my flickr page
I = imread('https://farm1.staticflickr.com/437/18409639743_ce62590762_z.jpg');
% convert to gray / intensity (from colour)
I_intensity = rgb2gray(I);

command line data munging

GNU/datamash a handy tool for doing maths + string operations (on files or stdout, stderr) on the the unix command line.

  1. (on macOS) Make sure you have the brew package manager installed:
which brew
# /usr/local/bin/brew

If you don't get a path returned, you need to install following instructions on https://brew.sh/

@schluppeck
schluppeck / Readme.md
Created June 25, 2018 22:39
Plot the 2017 Prices Paid Data set in R

R code to go along with a blog post on how to move "From Excel to R"

Enjoy. DS

@schluppeck
schluppeck / data.md
Last active February 26, 2018 19:08
linear regression example in R

Linear regression gist

This is the code snippets for a simple linear regression analysis. The properly rendered version of this R-markdown file includes nice graphs.

Dataset

The data set comes from the Companion to Applied Regression (CAR). I just picked the Salaries dataset because it has severeal independent variables - some of them categorical, some real-valued (on a interval/ratio scale).

@schluppeck
schluppeck / grade_summary.R
Created February 15, 2018 15:16
summarising grades by questions (tidy_
library(tidyverse)
# simulate data
n_students <- 50;
grades <- c(100,
85,
78,
72,
68,
65,
@schluppeck
schluppeck / .block
Created February 13, 2018 14:54
ggplot + crosshatching
license: mit
#! /bin/bash
#
# imagemagick script for merging a texture background image
# with separate images of wands that we produced for the
# 7th birthday party of our twins
#
# 2018-02-02
# sample texture
bgTexture=TEXTURE_C.jpg