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 | |
# | |
# This script does this: | |
# launch an app if it isn't launched yet, | |
# focus the app if it is launched but not focused, | |
# minimize the app if it is focused. | |
# | |
# by desgua - 2012/04/29 | |
# modified by olds22 - 2012/09/16 | |
# - customized to accept a parameter |
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
rm ~/.config/spotify -r && rm ~/.cache/spotify -r |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } }, | |
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }, | |
{ "keys": ["ctrl+keypad_divide"], "command": "toggle_comment", "args": { "block": false } }, | |
{ "keys": ["ctrl+shift+keypad_divide"], "command": "toggle_comment", "args": { "block": true } }, | |
] |
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
# coding=utf-8 | |
import json | |
from django.contrib import messages | |
class AjaxMessaging(object): | |
def process_response(self, request, response): |
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
def format_currency(value, decimal_points=3, seperator=u'.', money=u'$'): | |
value = str(value) | |
if len(value) <= decimal_points: | |
return value | |
parts = [] | |
while value: | |
parts.append(value[-decimal_points:]) | |
value = value[:-decimal_points] | |
parts.reverse() | |
value = "%s %s" % (money, seperator.join(parts)) |
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 python | |
# -*- coding: utf-8 -*- | |
from datetime import datetime | |
all_dates = ['09-2012', '04-2007', '11-2012', '05-2013', '12-2006', '05-2006', '08-2007'] | |
sorted(all_dates, key=lambda x: datetime.strptime(x, '%m-%Y')) |
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
# You might want to increase your video memory to at least 128 MB. For newer firmware version this can be done by adding the line on "/boot/config.txt" | |
gpu_mem=128 | |
(possible values: 16, 64, 128, 256) to your |
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
# run as root | |
rm -rf /usr/local/lib/node_modules | |
brew uninstall node | |
brew install node --without-npm | |
echo prefix=~/.node >> ~/.npmrc | |
curl -L https://www.npmjs.com/install.sh | sh | |
# edit ~/.bash_profile |
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
BROKER_URL = 'amqp://user:passwd@127.0.0.1/host' | |
BROKER_BACKEND = 'amqp' | |
CELERY_ACCEPT_CONTENT = ['json', 'pickle', 'msgpack', 'yaml'] | |
CELERY_TASK_SERIALIZER = 'json' | |
CELERY_RESULT_SERIALIZER = 'json' | |
CELERY_IGNORE_RESULT = False | |
CELERY_RESULT_BACKEND = 'amqp' | |
CELERY_SEND_TASK_ERROR_EMAILS = True | |
CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler" |
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
konsolex=$(qdbus | grep konsole | cut -f 2 -d\ ) | |
if [ -n konsolex ]; then | |
for konsole in $konsolex | |
do | |
xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -id `qdbus $konsole /konsole/MainWindow_1 winId`; | |
done | |
fi | |
if [ `qdbus | grep yakuake` ]; then | |
xprop -f _KDE_NET_WM_BLUR_BEHIND_REGION 32c -set _KDE_NET_WM_BLUR_BEHIND_REGION 0 -name Yakuake; | |
fi |