Skip to content

Instantly share code, notes, and snippets.

View metaodi's full-sized avatar

Stefan Oderbolz metaodi

View GitHub Profile
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@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 / 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 / move_user.sql
Last active January 2, 2016 21:39
Copy values from one kort user to another to move a user to another OAuth provider
UPDATE kort.user
SET name = sub.name,
username = sub.username,
koin_count = sub.koin_count,
token = sub.token,
oauth_provider = sub.oauth_provider,
oauth_user_id = sub.oauth_user_id,
pic_url = sub.pic_url,
secret = sub.secret
FROM (SELECT name, username, koin_count, token, oauth_provider, oauth_user_id, pic_url, secret
@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}'\'
@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 / .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 / .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"]