Skip to content

Instantly share code, notes, and snippets.

View ThiefMaster's full-sized avatar
🐈
Scratching your code.

Adrian ThiefMaster

🐈
Scratching your code.
  • CERN / @indico
  • Geneva, Switzerland
View GitHub Profile
{%- macro form_field_label(field, label_for=true) -%}
<label{% if label_for %} for="{{ field.id }}"{% endif %}>{{ field.label.text }}
{%- if field.flags.required -%}
<span class="ym-required" title="Dieses Feld muss ausgefüllt werden.">*</span>
{%- endif %}</label>
{% endmacro %}
{%- macro form_field_errors(field) -%}
{% if field.errors %}
<strong class="ym-message">
#!/bin/bash
# tmux-smartsplit
# open a new tmux (split-)window which will automatically
# continue the existing ssh session if one exists
SIP=$(tmux display-message -p "#S:#I:#P")
PTY=$(tmux server-info |
egrep flags=\|bytes |
awk '/windows/ { s = $2 }
/references/ { i = $1 }
#!/bin/sh
#
# indico-scheduler init file for starting up the indico scheduler
#
# chkconfig: - 20 80
# description: Starts and stops the zodb daemon.
### BEGIN INIT INFO
# Provides: indico-scheduler
# Required-Start: $local_fs $network
__auto_venv() {
local venv="$HOME/.python-env"
local current="$VIRTUAL_ENV"
local ps1
# check if we are REALLY inside a venv and not just inherited $VIRTUAL_ENV
if ! type -t deactivate > /dev/null; then
current=""
fi
#!/bin/bash
n=0
lines=
newline='
'
LINES=$(tput lines)
case $LINES in
''|*[!0-9]*) exec less;;
@ThiefMaster
ThiefMaster / .gitconfig
Last active September 18, 2018 12:13
my git config
[alias]
lg = log --color=always --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
lga = log --color=always --graph --pretty=tformat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --abbrev-commit --date=iso
purr = pull --rebase
puff = pull --ff-only
mff = merge --ff-only
fall = fetch --all
pigamend = "!f(){ git add -u && git commit --amend --no-edit; }; f"
[color]
ui = auto
@ThiefMaster
ThiefMaster / tmux.conf
Last active November 23, 2020 05:34
my tmux config
set -g prefix C-a
bind C-s send-prefix
bind F11 set -g prefix C-a \; display-message 'Prefix: ^A'
bind F12 set -g prefix C-b \; display-message 'Prefix: ^B'
unbind Space
bind h clear-history \; display-message 'Cleared history'
bind C new-window -c ~
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
@ThiefMaster
ThiefMaster / promptrc.sh
Created December 23, 2013 00:55
a nice bash prompt
# vim: ft=sh
function set_prompt {
local BLACK="\[\033[0;30m\]"
local BLUE="\[\033[0;34m\]"
local GREEN="\[\033[0;32m\]"
local CYAN="\[\033[0;36m\]"
local RED="\[\033[0;31m\]"
local PURPLE="\[\033[0;35m\]"
local BROWN="\[\033[0;33m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
@ThiefMaster
ThiefMaster / darkblue_256.vim
Created December 22, 2013 16:46
darkblue.vim, modified to look good fine on xterm-256color
" Vim color file
" Maintainer: Bohdan Vlasyuk <bohdan@vstu.edu.ua>
" Last Change: 2006 Apr 30
" darkblue -- for those who prefer dark background
" [note: looks bit uglier with come terminal palettes,
" but is fine on default linux console palette.]
set bg=dark
hi clear
insmod all_video
insmod png
insmod gfxmenu
insmod font
loadfont $prefix/themes/starfield/dejavu_10.pf2
loadfont $prefix/themes/starfield/dejavu_12.pf2
loadfont $prefix/themes/starfield/dejavu_14.pf2
loadfont $prefix/themes/starfield/dejavu_16.pf2
loadfont $prefix/themes/starfield/dejavu_bold_14.pf2