return HttpResponse(simplejson.dumps(your_data),
mimetype='application/json; charset=utf-8')
Showing posts with label snippets. Show all posts
Showing posts with label snippets. Show all posts
Dajngo app unicode JSON repsonse
If your django application has unicode data, and your view uses jquery and JSON response, do not forget to specify the encoding for the mimetype:
Resize files using one command
Using ImageMagick it is easy to resize multiple images by the following command:
A bit detailed version of this script can be found in my bitbucket repository: resizer.sh
for i in `ls *.JPG`; do convert -resize 1024 $i $i; done
A bit detailed version of this script can be found in my bitbucket repository: resizer.sh
Find duplicated files in a directory subtree
Unpack compressed files into separate directories
Here is a little script to unpack all compressed files such as *.rar and put them into a separate directory:
for f in *.rar;do n=${f%.rar};mkdir "$n"; unrar x "$f" "$n/";done
Subscribe to:
Posts (Atom)