Skip to content

Instantly share code, notes, and snippets.

Avatar

Werner Robitza slhck

View GitHub Profile
View open-with-google-docs.sh
#!/bin/sh
#
# Opens a local document, using Google Docs.
#
# If the document does not exist on Google Docs, it is uploaded and opened. If
# the document already exists (filename matches exactly) then the existing
# document is opened.
#
# Requires googlecl. Written for Mac OS X.
#
@slhck
slhck / xml-directory.rb
Created Nov 10, 2011
Create an XML representation of a directory tree
View xml-directory.rb
#!/usr/bin/env ruby
# xml-directory.rb
# Author: Werner Robitza
# Synopsis: A basic XML writer that parses the current directory and files
# Usage: xml-reader.rb <path> <output> [-a]
# <path> the directory path that should be analyzed
# <output> the output file
# -a output with XML attributes too instead of just using XML elements
require 'nokogiri'
@slhck
slhck / rss-reader.rb
Created Nov 10, 2011
A simple RSS/Atom reader for Ruby
View rss-reader.rb
#!/usr/bin/env ruby
# rss-reader.rb
# Author: Werner Robitza
# Synopsis: A basic console RSS News Feed reader
# Usage: rss-reader.rb <url> <granularity>
# <url> being the URL of the RSS news feed
# <granularity> is one of: short | medium | full
require 'open-uri'
require 'nokogiri'
@slhck
slhck / copy.user.js
Last active Dec 15, 2015
Copy User Links
View copy.user.js
// ==UserScript==
// @name Copy User Links
// @author Werner Robitza
// @namespace
// @description Adds a button for copying superping-ready user names of close voters
// @include http://stackoverflow.com/*
// @include http://meta.stackoverflow.com/*
// @include http://superuser.com/*
// @include http://serverfault.com/*
// @include http://meta.superuser.com/*
@slhck
slhck / analyze.r
Last active Dec 19, 2015
Converts raw NappingPlayer output to a summary data frame.
View analyze.r
#!/usr/bin/env Rscript
#
# Synopsis: Converts raw NappingPlayer output to a summary data frame for
# input in FactoMineR or SensoMineR. This also contains a few examples.
# Comment out the lines you don't need, or browse through the source.
# Author: Werner Robitza, <werner.robitza@univie.ac.at>
# Known issues: At the moment there might be a problem with non-alphanumeric names being used.
# Report bugs here, please: https://github.com/slhck/napping-player/issues
# Change the working directory that contains your raw tablet data files
@slhck
slhck / recursive-file-hash.rb
Created Nov 10, 2011
Recursively build a hash for directory listing
View recursive-file-hash.rb
#!/usr/bin/env ruby
# Recursively build a hash for directory listing
def create_hash(path, name = nil)
data = {:parent => (name || path)}
data[:children] = children = []
Dir.foreach(@path) do |entry|
next if entry == '..' or entry == '.'
full_path = File.join(path, entry)
if File.directory?(full_path)
@slhck
slhck / convert-avrate-logs.rb
Created Nov 25, 2016
Converts Logs from AVRate into parsable, tidy format
View convert-avrate-logs.rb
#!/usr/bin/env ruby
#
# Author: Werner Robitza
# Synopsis: Converts AVRate logs into a parsable, tidy format with one row per rating
# Requirements: gem install trollop awesome_print
require 'trollop'
require 'ap'
require 'csv'
@slhck
slhck / # ffmpeg - 2016-12-07_07-12-17.txt
Created Dec 7, 2016
ffmpeg on macOS 10.10.5 - Homebrew build logs
View # ffmpeg - 2016-12-07_07-12-17.txt
Homebrew build logs for ffmpeg on macOS 10.10.5
Build date: 2016-12-07 07:12:17
@slhck
slhck / # ffmpeg - 2016-12-07_07-31-06.txt
Created Dec 7, 2016
ffmpeg on macOS 10.10.5 - Homebrew build logs
View # ffmpeg - 2016-12-07_07-31-06.txt
Homebrew build logs for ffmpeg on macOS 10.10.5
Build date: 2016-12-07 07:31:06
@slhck
slhck / # python3 - 2017-01-23_14-52-08.txt
Created Jan 24, 2017
python3 on macOS 10.10.5 - Homebrew build logs
View # python3 - 2017-01-23_14-52-08.txt
Homebrew build logs for python3 on macOS 10.10.5
Build date: 2017-01-23 14:52:08