Skip to content

Instantly share code, notes, and snippets.

View Ramblurr's full-sized avatar

Casey Link Ramblurr

View GitHub Profile
#-- vim:sw=2:et
#++
# :title: the fucking weather plugin for rbot
#
# Author:: Casey Link <unnamedrambler@gmail.com>
# Copyright:: (C) 2009 Casey Link
#
# License:: GPL 2+
require 'cgi'
class FUWeather < Plugin
@Ramblurr
Ramblurr / qt-poppler-pdf2txt.cpp
Created October 15, 2009 17:17
Qt4 Poppler bindings to convert a pdf file into text
#include <poppler-qt4.h>
#include <QRectF>
#include <QDebug>
#include <QFile>
#include <QTextStream>
void pdftotext( const QString &filename )
{
Poppler::Document *doc = Poppler::Document::load(filename);
int count = doc->numPages();
@Ramblurr
Ramblurr / ChildrenFilteringProxyModel.cpp
Created August 9, 2010 16:41
Proxy model for filtering only the 1st level children in a treemodel. Assumes 1 column, 2 level tree.
/**
Proxy model for filtering only the 1st level children in a treemodel. Assumes 1 column, 2 level tree.
If the source model is:
Parent 1
- child 1
- child 2
Parent 2
- child 4
- child 5
@Ramblurr
Ramblurr / scorer.py
Created April 29, 2011 23:28
Iterated Prisoner's Dilemma Scorer
#! /usr/bin/python
#
# Iterated prisoner's dilemma King of Hill Script Argument is a
# directory. We find all the executables therein, and run all possible
# binary combinations (including self-plays (which only count once!)).
import subprocess
import os
import sys
RESULTS = {"cc":(2,"K"), "ct":(-1,"R"), "tc":(4,"S"), "tt":(1,"E")}
@Ramblurr
Ramblurr / key32to16.py
Created December 7, 2011 21:51
Converts a base32 encoded string to a base 16 string
#!/usr/bin/env python2
# Converts a base32 encoded string to a base 16 string
# requires numconv package
import numconv
import re
google_key = raw_input("Google key: ")
@Ramblurr
Ramblurr / owncloud.sh
Created August 13, 2012 16:18 — forked from dirkk0/owncloud.sh
owncloud installation on Amazon EC2
#!/bin/bash
VERSION=4.0.6 # desired owncloud version
if [[ $EUID -ne 0 ]]; then
echo "You must be a root user" 2>&1
exit 1
fi
@Ramblurr
Ramblurr / go_go_tor_relay.sh
Created November 14, 2012 14:58
Setup tor relay on debian squeeze
#!/bin/bash
####
# Simple tor relay (non-exit) setup for Debian squeeze
####
# begin user config
EXTERNAL_IP= # your external ip
MAX_MONTHLY_BW= # maximum GB per month you can spare for a tor relay
NICKNAME=atorrelay # custom nickname (will show in tor directory)
RELAY_PORT=443 # port to accept incoming connections on (open in your firewall!)
UnBundle 'mattn/webapi-vim'
UnBundle 'spf13/vim-autoclose'
UnBundle 'amirh/HTML-AutoCloseTag'
UnBundle 'matchit'
UnBundle 'Puppet-Syntax-Highlighting'
UnBundle 'groenewege/vim-less'
UnBundle 'tpope/vim-cucumber'
UnBundle 'tpope/vim-rails'
UnBundle 'derekwyatt/vim-sbt'
UnBundle 'derekwyatt/vim-scala'
@Ramblurr
Ramblurr / gist:5840573
Last active December 18, 2015 20:29
Travel Logistics

Maps

Android

Offline maps

  • Openandromaps - free vector maps covering the whole world for outdoor sport use, work best with Locus or Oruxmaps. OSM data with tags tweaked for outdoor sports.

Trains

@Ramblurr
Ramblurr / gist:5840788
Last active December 18, 2015 20:29
Howto: Making your own guidebooks with Wiki Voyage

Custom Wiki Voyage guidebooks

Wiki Voyage, as part of the wikimedia project, has an incredibly useful tool simply called "Books". This features allows users the ability to collate various articles into a collection using the book creator tool. Wikivoyage books can be easily saved, rendered electronically in PDF, EPUB, ZIM or OpenDocument format, or ordered as a printed book.

The Help:Books page explains everything you need to know to use the feature.

Here is a sample workflow I use to create a custom guidebook for a particular region or regions.

The structure of Wiki Voyage is hierarchical with pages existing under categories. For example, "Category:Germany", is under "Category:Central_Europe" which is under "Category:Europe".