Skip to content

Instantly share code, notes, and snippets.

Dan Fitch dgfitch

Block or report user

Report or block dgfitch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dgfitch
dgfitch / nih_toolbox.php
Created Aug 29, 2019
Simple web service endpoint for NIH Toolbox in PHP
View nih_toolbox.php
<?php
$target_dir = "uploads/";
error_reporting(-1);
ini_set('display_errors', 'On');
date_default_timezone_set('America/Chicago');
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
header('Content-Length: 0');
header('Connection: keep-alive');
@dgfitch
dgfitch / vlc_pyglet.py
Created Apr 26, 2019
Using libvlc from python to display video via OpenGL (cheating slightly with pyglet)
View vlc_pyglet.py
from __future__ import absolute_import, division, print_function
import time
import os
import sys
import threading
import logging
import ctypes
@dgfitch
dgfitch / README.md
Last active Apr 3, 2019
Draw your feels
View README.md

Preliminary experimenting with d3, "draw your feelings"

@dgfitch
dgfitch / gulp.txt
Created Mar 28, 2017
Gulp error trying to watch gibber.graphics.lib
View gulp.txt
dan@batman:~/git/gibber.graphics.lib$ gulp
[19:52:44] Warning: gulp version mismatch:
[19:52:44] Global gulp is 3.9.1
[19:52:44] Local gulp is 3.8.11
[19:52:44] Using gulpfile ~/git/gibber.graphics.lib/gulpfile.js
[19:52:44] Starting 'client'...
[19:52:44] 'client' errored after 22 ms
[19:52:44] TypeError: gulp.src(...).pipe(...).pipe is not a function
at Gulp.<anonymous> (/home/dan/git/gibber.graphics.lib/gulpfile.js:23:6)
at module.exports (/home/dan/git/gibber.graphics.lib/node_modules/orchestrator/lib/runTask.js:34:7)
@dgfitch
dgfitch / FogbugzToPhabricator.fs
Created Jun 1, 2015
Automated Fogbugz export to Phabricator import in F#
View FogbugzToPhabricator.fs
open FSharp.Data
open FSharp.Data.JsonExtensions
open System.Xml
open System.Net
open System.Web
open System.IO
open System.Text
(*
@dgfitch
dgfitch / git-checkpoint.sh
Created Apr 28, 2015
git-checkpoint: Script to allow non-git-experts to use git with a single command, "git checkpoint"
View git-checkpoint.sh
#!/bin/sh
# git-checkpoint
# ==============
# Minimal version tracking with git using a single command.
#
# Intended to ease people new to git into easy versioning
# in a single server repository location, but they can also
# expand on their knowledge and use other git commands as
# they learn.
@dgfitch
dgfitch / level1_qc.bash
Last active May 23, 2016
Level 1 QC script converted to bash with some functions and features
View level1_qc.bash
#!/bin/bash
#
# Script that combines all run images into one
# html file for quality assurance.
#
# Assess plots for unusually bad motion or extreme
# amounts of censoring
#
# Examples of functions and redirecting output
#
@dgfitch
dgfitch / gcCursor_excerpt.py
Created Jan 9, 2015
Example of drawing left and right eye data in gcCursor psychopy example
View gcCursor_excerpt.py
while run_trial is True:
imageStim.draw()
# Additional debug dumping crap
data=tracker.getLastSample()
if data:
gaze_dot_left.setPos([data[11],data[12]])
gaze_dot_left.draw()
gaze_dot_right.setPos([data[30],data[31]])
gaze_dot_right.draw()
@dgfitch
dgfitch / gist:4636234
Created Jan 25, 2013
VB Area API routes
View gist:4636234
Public Overrides Sub RegisterArea(ByVal context As System.Web.Mvc.AreaRegistrationContext)
'' general api routes
context.MapRoute(
"api_default_sub_resource",
"api/v1/{controller}/{resource}/{subresource}/{action}.xml",
New With {.version = "1"}
)
context.MapRoute(
@dgfitch
dgfitch / http_stopwatch.fs
Created Oct 4, 2011
Simple HTTP statistics timer in F#
View http_stopwatch.fs
open System
open System.IO
open System.Net
open System.Diagnostics
let track (url:string) (log:string) =
while true do
let stopwatch = new Stopwatch()
stopwatch.Start()
You can’t perform that action at this time.