This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple decorator for logging out django db queries | |
# just put it along with other decorators before view or | |
# db-loading stuff. than go to your console and see whats going on. | |
# example: | |
# | |
# @log_db_queries | |
# @login_required | |
# def your_view(request, args...): | |
# your stuff | |
def log_db_queries(f): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# function takes 2 arguments | |
# $1 - file to watch for changes | |
# $2 - how long to watch in seconds | |
# it echoes "0" if file size was not changed during watching | |
# and "1" if file does not exist or file size was changed | |
# example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# script to show biggest packages at your rpm-based system | |
# just run it like 'python biggest_packages.py | less' | |
import subprocess | |
packages = {} | |
process = subprocess.Popen(r"rpm -qa --queryformat '%{size}|%{name}-%{version}-%{release}\n'", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Example of usage && output: | |
# $ls_path.sh /home/bak1an/Music | |
# drwxr-xr-x 6 root root 4.0K May 30 2011 /home | |
# drwxr-xr-x 226 bak1an bak1an 24K Jan 26 16:08 /home/bak1an | |
# drwxr-xr-x 112 bak1an bak1an 12K Nov 7 17:51 /home/bak1an/Music | |
path="$1"; | |
while [[ $path ]]; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put git-completion.bash and git-prompt.sh from contrib/completion to SOMEDIR | |
for f in $SOMEDIR/*; do source $f; done | |
GIT_PS1_SHOWDIRTYSTATE=true | |
export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1)\[\033[00m\]\[\033[01;34m\] \$\[\033[00m\] ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# found here http://stackoverflow.com/a/8507440 | |
class Maybe(): | |
def andThen(self, action): # equivalent to Haskell's >>= | |
if self.__class__ == _Maybe__Nothing: | |
return Nothing | |
elif self.__class__ == Just: | |
return action(self.value) | |
def followedBy(self, action): # equivalent to Haskell's >> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Anton Baklanov | |
email = antonbaklanov@gmail.com | |
[core] | |
editor = vim | |
[merge] | |
tool = kdiff3 | |
[color] | |
ui = true | |
status = auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put it to ~/.config/Terminal/terminalrc | |
# found here http://blogs.n1zyy.com/andrew/2009/02/02/tango-color-scheme-for-xfce-terminal/ | |
[Configuration] | |
ColorForeground=White | |
ColorBackground=#323232323232 | |
ColorPalette1=#2e2e34343636 | |
ColorPalette2=#cccc00000000 | |
ColorPalette3=#4e4e9a9a0606 | |
ColorPalette4=#c4c4a0a00000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
# | |
# This file, gist, is generated code. | |
# Please DO NOT EDIT or send patches for it. | |
# | |
# Please take a look at the source from | |
# http://github.com/defunkt/gist | |
# and submit patches against the individual files | |
# that build gist. |
OlderNewer