This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# rss-to-pdf.rb | |
# Author: Werner Robitza | |
# Synopsis: A basic console RSS to PDF writer using the prawn library | |
# Usage: rss-to-pdf.rb <url> | |
# <url> being the URL of the RSS news feed | |
require 'open-uri' | |
require 'nokogiri' | |
require 'pp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# calculates the difference between time as | |
# "HH:MM:SS.msec" and "HH:MM:SS.msec" | |
# into a file called diffs.txt | |
require "Time" | |
def time_diff(time1_str, time2_str) | |
t = Time.at( Time.parse(time2_str) - Time.parse(time1_str) ) | |
(t - t.gmt_offset).strftime("%H:%M:%S.%L") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Batch encodes videos from a list of editing points | |
# Author: Werner Robitza <[email protected]> | |
FFMPEG = "ffmpeg" # => path to the FFmpeg executable | |
COPY = false # => if set to true, just does a bitstream copy | |
# => if set to false, encoding options below are used | |
OVERWRITE = "-n" # => set to "-n" if you just want to keep files that exist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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, <[email protected]> | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
CALLERS_UID="$1" | |
REFCOUNT_PATH="$2" | |
DCALL_PATH="$3" | |
if [ $UID -ne 0 ]; then | |
# Test that the script is run as root. | |
echo "Script must run as root" | |
exit 1 |
OlderNewer