Skip to content

Instantly share code, notes, and snippets.

View metaodi's full-sized avatar

Stefan Oderbolz metaodi

View GitHub Profile
@metaodi
metaodi / hockeytoto.userscript.js
Last active August 29, 2015 14:06
Userscript to filter teams on hockeytoto.ch
// filter for results of one team on hockeytoto.ch
// version 2.0
// 11.09.2014
// Copyright (c) 2014, Stefan Oderbolz
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
@metaodi
metaodi / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@metaodi
metaodi / vagrant-status
Created May 31, 2015 22:05
Status of all local vagrant boxes
#!/bin/bash
root_dir="$HOME"
if [ -n "$1" ] ; then
root_dir=$1
fi
for vdir in `find $root_dir -name .vagrant -type d 2>/dev/null`; do
cd $vdir
cd ..
vtext=`vagrant status 2>/dev/null | awk '{$1=""; print $0}' | sed 's/^ //g' | grep 'virtualbox' | GREP_COLOR="2;32" egrep --color=always "(not created|poweroff)"`
if [ -z "$vtext" ] ; then
@metaodi
metaodi / gist:432f4988974240bad101
Created July 7, 2015 12:53
Story Point Count in Confluence when using the Jira macro
<div id="count-1"></div>
<script>
window.setTimeout(function() {
var sum = 0;
$('table:eq(0) tr[class^="row"]').each(function() {
storyPoint = jQuery(this).find("td:eq(4)");
value = parseInt(storyPoint.text());
if (! isNaN(value)) {
sum += value;
}
@metaodi
metaodi / .gitconfig
Last active October 7, 2015 12:58
Windows .gitconfig
[merge]
tool = beyondmerge
[mergetool "beyondmerge"]
cmd = beyondmerge.sh "$PWD/$LOCAL" "$PWD/$BASE" "$PWD/$REMOTE" "$PWD/$MERGED"
trustExitCode = false
[mergetool "kdiff3"]
path = c:/Program Files (x86)/KDiff3/kdiff3.exe
[diff]
guitool = kdiff3
[difftool "kdiff3"]
@metaodi
metaodi / .bash_profile
Created July 24, 2012 17:19
Show current git branch in bash prompt
# basic code from http://www.developerzen.com/2011/01/10/show-the-current-git-branch-in-your-command-prompt/
# Parse current git branch if available
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
@metaodi
metaodi / .vimrc
Created August 13, 2012 06:29
Vim config (.vimrc)
" Attempt to determine the type of a file based on its name and possibly its
" contents. Use this to allow intelligent auto-indenting for each filetype,
" and for plugins that are filetype specific.
filetype indent plugin on
" Enable syntax highlighting
syntax on
" Highlight searches (use <C-L> to temporarily turn off highlighting; see the
" mapping of <C-L> below)
@metaodi
metaodi / .bashrc
Created November 16, 2012 17:26
Bash RC
alias duf='du -sk * | sort -n | perl -ne '\''($s,$f)=split(m{\t});for (qw(K M G)) {if($s<1024) {printf("%.1f",$s);print "$_\t$f"; last};$s=$s/1024}'\'
// ==UserScript==
// @name Tabs to spaces for GitLab
// @namespace http://liip.ch/
// @version 0.1
// @description Fix tab bug of GitLab/Chromium 45 (https://gitlab.com/gitlab-org/gitlab-ce/issues/3220)
// @author Odi
// @match https://gitlab.liip.ch/*
// @grant none
// ==/UserScript==
/* jshint -W097 */
@metaodi
metaodi / remove-text-rendering.user.js
Last active November 10, 2015 08:29
Remove text-rending to fix Chromium 45 bug
// ==UserScript==
// @name Remove text-rending to fix Chromium 45 bug
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://gitlab.liip.ch
// @grant none
// ==/UserScript==
/* jshint -W097 */