Skip to content

Instantly share code, notes, and snippets.

View slhck's full-sized avatar

Werner Robitza slhck

View GitHub Profile
@slhck
slhck / open-with-google-docs.sh
Created June 15, 2011 20:38
Google Docs Upload
#!/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 November 10, 2011 15:15
Create an XML representation of a directory tree
#!/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 November 10, 2011 15:16
A simple RSS/Atom reader for Ruby
#!/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 December 15, 2015 09:09
Copy User Links
// ==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 December 19, 2015 09:39
Converts raw NappingPlayer output to a summary data frame.
#!/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 November 10, 2011 15:14
Recursively build a hash for directory listing
#!/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 November 25, 2016 10:13
Converts Logs from AVRate into parsable, tidy format
#!/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 December 7, 2016 12:20
ffmpeg on macOS 10.10.5 - Homebrew build logs
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 December 7, 2016 12:34
ffmpeg on macOS 10.10.5 - Homebrew build logs
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 January 24, 2017 12:40
python3 on macOS 10.10.5 - Homebrew build logs
Homebrew build logs for python3 on macOS 10.10.5
Build date: 2017-01-23 14:52:08