Skip to content

Instantly share code, notes, and snippets.

View remomueller's full-sized avatar

Remo Mueller remomueller

  • Boston, MA
View GitHub Profile
@remomueller
remomueller / ruby200-devkit-mysql.md
Last active April 5, 2018 09:29
Installation of Ruby 2.0.0-p0 on Windows 7 (64-bit) with DevKit and MySQL instructions

Install Ruby

Run rubyinstaller-2.0.0.p0.exe

  • Add Ruby executables to your PATH
  • Associate .rb and .rbw files with this Ruby installation
@remomueller
remomueller / xml_testing.rb
Last active June 9, 2017 14:55
XML Integrity Checking
# frozen_string_literal: true
# https://gist.github.com/remomueller/c853734a2f85937b69b373c46760fcdd
# gem install xml-simple colorize --no-document
# ruby xml_testing.rb
# XML Integrity Checking
# I think checking through all XML for the following would be a good place to
@remomueller
remomueller / ruby_2_4_0_integer_fixes.rb
Last active February 20, 2017 14:45
Cleans up some deprecation notices that can clutter up tests on Ruby 2.4.0, can be placed in `config/initializers`.
# Fixes gems that reference Fixnum explicitly. Replaces `Fixnum` with `0.class`.
# mail-2.6.4/lib/mail/attachments_list.rb:33
module Mail
class AttachmentsList < Array
def [](index_value)
if index_value.is_a?(0.class)
self.fetch(index_value)
else
self.select { |a| a.filename == index_value }.first
@remomueller
remomueller / tutorial_05.rb
Created January 31, 2017 15:18
Counting Apneas in EDF Annotations
# tutorial_05.rb
# sleepdata.org
# author: @remomueller
#
# Required Gems:
#
# gem install colorize nsrr xml-simple --no-document
#
# To Run Script:
#
@remomueller
remomueller / tutorial_04.rb
Last active January 31, 2017 15:00
Compute EDF Signal Averages
# tutorial_04.rb
# sleepdata.org
# author: @remomueller
#
# Required Gems:
#
# gem install colorize edfize nsrr --no-document
#
# To Run Script:
#
@remomueller
remomueller / tutorial_03.rb
Last active January 31, 2017 14:38
Rewrite EDF Header Start Date of Recording
# tutorial_03.rb
# sleepdata.org
# author: @remomueller
#
# Required Gems:
#
# gem install colorize edfize nsrr --no-document
#
# To Run Script:
#
@remomueller
remomueller / tutorial_02.rb
Created January 30, 2017 18:31
Read EDF Header and Signal Header
# tutorial_02.rb
# sleepdata.org
# author: @remomueller
#
# Required Gems:
#
# gem install colorize edfize nsrr --no-document
#
# To Run Script:
#
@remomueller
remomueller / tutorial_01.rb
Last active January 30, 2017 17:19
Download EDFs programmatically
# tutorial_01.rb
# sleepdata.org
# author: @remomueller
#
# Required Gems:
#
# gem install colorize edfize nsrr --no-document
#
# To Run Script:
#
@remomueller
remomueller / loading_annotations.rb
Last active December 14, 2016 17:05
Simple script for loading and retrieving information from annotation files.
# frozen_string_literal: true
# gem install xml-simple --no-document
# ruby loading_annotations.rb
require 'rubygems'
require 'csv'
require 'xmlsimple'
@remomueller
remomueller / annotation_testing.rb
Last active December 9, 2016 19:19
Parse XML Annotation Files and retrieve time asleep and number of obstructive apnea events.
# frozen_string_literal: true
# gem install xml-simple colorize --no-document
# ruby annotation_testing.rb
require 'rubygems'
require 'colorize'
require 'json'
require 'xmlsimple'