Skip to content

Instantly share code, notes, and snippets.

View rwoeber's full-sized avatar

Richard Wöber rwoeber

  • Würzburg, Germany
View GitHub Profile
@rwoeber
rwoeber / latex_frutiger_ttf.sh
Created March 17, 2015 14:05
Install Frutiger TTF for latex (in case you cannot use xetex)
#!/bin/bash
# via https://devnotcorp.wordpress.com/2011/06/10/use-truetype-font-with-pdflatex/
# Copyright (C) InnoviData GmbH <http://www.innovidata.com>, 2011.
# Author: Holger Widmann <[email protected]>
# Version: 1.2.20110610
#
# License:
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (LGPL) as
# published by the Free Software Foundation, either version 3 of the
@rwoeber
rwoeber / junit4.java
Created January 3, 2015 13:22
IntelliJ IDEA junit4-Template
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import static org.junit.Assert.*;
@RunWith(JUnit4.class)
public class ${NAME} {
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'

Keybase proof

I hereby claim:

  • I am rwoeber on github.
  • I am rwoeber (https://keybase.io/rwoeber) on keybase.
  • I have a public key whose fingerprint is FE5B C207 DA8F CC65 A1EA 5CEE A92E 9852 5B8D 6A5F

To claim this, I am signing this object:

@rwoeber
rwoeber / log.txt
Last active August 29, 2015 14:06 — forked from steveklabnik/log.txt
$ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
610 git status
568 git commit -m
491 git add .
252 git push origin
176 bundle
138 rails s
128 ls
120 git commit --amend
114 git reset --hard
@rwoeber
rwoeber / maven.plugin.zsh
Last active August 13, 2019 12:01 — forked from evelyne24/README
oh-my-zsh Plugin to colorize Maven. Put in `${OH_MY_ZSH_HOME}/custom/plugins/maven` and add to plugins array in `.zshrc`
# Original from https://gist.github.com/evelyne24/7714094
# Notes
# In MacOS, + does not work for regex, nor -E flag.
# Instead I used \{1,\} for char repetition.
# Formatting constants
bold=`tput bold`
red=`tput setaf 1`
bg_red=`tput setab 1`
green=`tput setaf 2`
@rwoeber
rwoeber / gist:11314156
Created April 26, 2014 07:36
Simple nested_layout for rails
# via http://grosser.it/2010/02/25/simple-nested_layout-for-rails/
# application_helper.rb
def nested_layout(layout, &block)
@content_for_layout = capture(&block)
concat(render :file => layout)
end
# layouts/xxxx.erb
<% nested_layout 'layouts/application' do %>
@rwoeber
rwoeber / gist:9889365
Created March 31, 2014 10:19
Merge Two Git Repositories Into One
# via http://jasonkarns.com/blog/merge-two-git-repositories-into-one/
# create new project as the parent
$ mkdir new_parent_project
$ cd new_parent_project
$ git init
$ touch .gitignore
$ git ci -am "initial commit"
# merge project A into subdirectory A
$ git remote add -f projA /path/to/projA
@rwoeber
rwoeber / gist:9889262
Created March 31, 2014 10:12
Query string to hash
# via https://twitter.com/RubyMotionTV/status/437503446166417409/photo/1
[3] pry(main)> s = 'key1=valueA&key2=valueB&key3=valueC'
#=> "key1=valueA&key2=valueB&key3=valueC"
[4] pry(main)> Hash[s.split(/[&=]/).each_slice(2).to_a]
#=> {"key1"=>"valueA", "key2"=>"valueB", "key3"=>"valueC"}
#!/usr/bin/env bash
# A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
# Author: Jaeho Shin <[email protected]>
# Created: 2011-03-24
# See-Also: http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin
# via https://gist.github.com/netj/930384
set -eu
newMailUUID=$(defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID)
newMsgUUID=$(defaults read /System/Library/Frameworks/Message.framework/Resources/Info PluginCompatibilityUUID)