Skip to content

Instantly share code, notes, and snippets.

View fallenhitokiri's full-sized avatar

Timo Zimmermann fallenhitokiri

View GitHub Profile
@fallenhitokiri
fallenhitokiri / config.yaml
Created July 6, 2014 16:46
screamingatmyscreen.com drupan 2 config
reader: "filesystem"
writer: "filesystem"
plugins: ["markdown", "blank", "tags"]
deployment: "s3sub"
url_scheme:
index: ""
archive: "/archive/"
tag: "/tag/%slug/"
post: "/%year/%month/%slug/"
page: "/%slug/"
@fallenhitokiri
fallenhitokiri / gist:dbaf0bec1f6e2793001e
Created July 6, 2014 14:12
drupan 2 MacBook Air mid 2013 (i7, SSD)
# 100 posts - 5 images
Shirayuki ~/Projects/drupan venv
$ time python drupan.py ~/tmp/screamingatmyscreen/config.yaml --nodeploy
python drupan.py ~/tmp/screamingatmyscreen/config.yaml --nodeploy 0,77s user 0,06s system 99% cpu 0,835 total
# 200 posts - 10 images
Shirayuki ~/Projects/drupan venv
$ time python drupan.py ~/tmp/screamingatmyscreen/config.yaml --nodeploy
python drupan.py ~/tmp/screamingatmyscreen/config.yaml --nodeploy 0,95s user 0,08s system 97% cpu 1,033 total
autoload -U colors && colors
autoload -U compinit && compinit
# completion
zstyle ':completion:*' menu select
setopt completealiases
# history
HISTFILE=$HOME/.zsh_history
HISTSIZE=1000
@fallenhitokiri
fallenhitokiri / .vimrc
Created May 5, 2014 15:00
backup of my vimrc
set nocompatible
set nobackup
set nowritebackup
set noswapfile
set history=100
set incsearch
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
func filterEntities(s []*Entity, key string, val string) (res []*Entity) {
val = strings.ToLower(val)
for _, e := range s {
switch reflect.ValueOf(e).Elem().FieldByName(key).Kind() {
case reflect.Slice:
imm := reflect.ValueOf(e).Elem().FieldByName(key)
for i := 0; i < imm.Len(); i++ {
v := imm.Index(i).String()
@fallenhitokiri
fallenhitokiri / .zshrc
Last active December 20, 2015 11:39
quick zsh configuration
autoload -U colors && colors
autoload -U compinit && compinit
# completion
zstyle ':completion:*' menu select
setopt completealiases
# history
HISTFILE=$HOME/.zsh_history
HISTSIZE=1000
@fallenhitokiri
fallenhitokiri / vimrc
Last active December 20, 2015 04:49
emergency vimrc
set nocompatible
set nobackup
set nowritebackup
set noswapfile
set history=100
set incsearch
set tabstop=4
set shiftwidth=4
set expandtab
set number
if [ $UID -eq 0 ]; then LOGINCOLOR="red"; else LOGINCOLOR="blue"; fi
function virtualenv_info {
[ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') '
}
PROMPT='%{${fg[blue]}%}[%{$reset_color%}%m%{${fg[blue]}%}]%{$reset_color%} %{${fg[magenta]}%}%B%3~%b %{$reset_color%}%{${fg[$LOGINCOLOR]}%}»%{$reset_color%} '
RPROMPT='$(git_prompt_info)'
@fallenhitokiri
fallenhitokiri / views.py
Created June 8, 2012 12:00
blog-tumblelog-5
from django.shortcuts import render_to_response
from django.template import RequestContext
from tumblelog.models import Entry, Tag
def tag(request, pid):
ci = RequestContext(request)
tmpl = {}
@fallenhitokiri
fallenhitokiri / models.py
Created June 8, 2012 11:49
blog-tumblelog-4
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_save
class Tag(models.Model):
name = models.CharField(max_length=400, unique=True)