Thu 30 May 2013
Noticed that pip install pyqt isn't working? At least at the time of
writing this blog it isn't..
This is the error that I got:
IOError: [Errno 2] No such file or directory: setup.py
It seems they didn't package it well and it's using configure.py to
install. So …
Continue reading »
Sat 11 May 2013
Tired of all those join part messages?
/ignore \* joins
/ignore \* parts
/ignore \* quits
/save
Read more about ignore /help ignore
Taken from Archwiki:
https://wiki.archlinux.org/index.php/Irssi
Continue reading »
Thu 02 May 2013
The following command first gets the changed and added files of a git
commit and then creates a tar archive of those changed files.
git show {{COMMIT_ID}} --name-status | grep -Ew '^M|A' | awk '{ print $2 }' | xargs tar czf usb-passthrough.tar.gz
Continue reading »
Wed 14 November 2012
I'm switching to a new laptop, but don't want to have to install
Archlinux again. So instead of re-installing I will try to copy all
files and hope the system will work. In this blogpost I will describe
the steps and issues I encountered while doing so.
Status: Succeeded!!!!
Summary …
Continue reading »
Fri 13 April 2012
For a mobile project I required a background worker which sents an email
with 300 generated QR codes zipped together as attachment. This costs
quite some time so we need a background worker to execute this task.
I wanted to achieve the following result:
- When the user wants to generate …
Continue reading »
Wed 11 April 2012
While setting up sentgrid I was searching for my password of sendgrid,
but coudn't find it. You can get it in the following way:
Which will show the parameters:
SENDGRID_PASSWORD, SENDGRID_USERNAME
After you get your username don't forget to add it to django settings:
Continue reading »
Thu 23 February 2012
To make my life easier I made a simple decorator which checks if the
parameters are present in the request.POST or request.GET and returns a
response if they are not.
It accepts a list of parameters in string format and will loop through
each parameter to check if …
Continue reading »
Wed 22 February 2012
Just a small code snippet I use when I need to return json, comments are
welcomed.
from django.http import HttpResponse
from django.utils import simplejson as json
def json_response(dict_to_convert_to_json):
return HttpResponse(json.dumps(dict_to_convert_to_json),
mimetype="application/json")
To use it in your view you just do it this …
Continue reading »
Sun 22 January 2012
The Chinese New Year aka Spring Festival is the most important festival
in Chinese culture. All the people travel back to their hometown,
because most of them are working/studying in cities far from their own
hometown. That means all train tickets are sold the day they get
available and …
Continue reading »
Tue 29 November 2011
I always keep forgetting how to import a SQL dump into postgres and
found it always hard to find the right documentation. So I thought lets
share it:
psql -d dbname -U username -f dumpfile.sql
This should also work with files created by pgdump.
Continue reading »