截止 2016.05.06 依然有效
最近遇到一个问题,想要给早期自己在豆瓣上收藏的看过的电影评分,但问题是一个一个修改的话巨慢,于是写了一个小plugin脚本,只要在firebug的console里运行了就好(Chrome里应该也可以).
前提:登陆自己的豆瓣账户,进入自己的电影列表(需要是列表模式)。
代码:(下面的code默认用到了 jQuery, 豆瓣支持此库)
截止 2016.05.06 依然有效
最近遇到一个问题,想要给早期自己在豆瓣上收藏的看过的电影评分,但问题是一个一个修改的话巨慢,于是写了一个小plugin脚本,只要在firebug的console里运行了就好(Chrome里应该也可以).
前提:登陆自己的豆瓣账户,进入自己的电影列表(需要是列表模式)。
代码:(下面的code默认用到了 jQuery, 豆瓣支持此库)
Related post is a very useful function which can keep the visitors surfing on your website based on the post tags.
You can install plugins to do this, or you can simply add the following codes in the single.php
I used to use php to handle ajax request, which is pretty easy. Using Django framework is a little complex, here is a simple example, and I’m sure there are other ways.
1. In your views.py:
(1) include the following lines
from json import dumps from django.views.decorators.csrf import csrf_exempt
When using static files in my Django application, the STATIC_URL is empty even I set it in the setting.py, after a few research, here is how I fixed it.
My static image files are located at movie/static/img (my application is movie)
1. in views.py
from django.template import RequestContext
if you use render_to_response, make sure you add context_instance=RequestContext(request)
in it,
render_to_response('movie/index.html', {'movie_list': movie_list}, context_instance=RequestContext(request));
In case you want to use Django framework in Godaddy’s Linux Economy Host, here is the steps:
1. Godaddy has virtualenv installed, so first, create a virtual environment venv: (I use $HOME/lib/ for all the installed stuff below)
cd ~/ mkdir lib cd lib virtualenv --no-site-packages venv
The python package folder is $HOME/lib/venv/lib/python2.7/site-packages
2. Install the latest Django through pip
pip install Django
There is no version control on Godaddy linux host, which makes the code deployment very painful. So here is how to setup Git on the Godaddy host.
In this tutorial, we set repository on the Godaddy host.
1. download the pre-build git binaries, Godaddy uses CentOS, and the binary is built under CentOS. (Thanks to here)
In your $HOME folder on Godaddy host
% mkdir lib % cd lib % mkdir git % cd git % wget http://www.lichun.cc/resources/centos5.2-git.tar.gz % tar -xvzf centos5.2-git.tar.gz
前天刚启用了新的域名(www.lichun.cc),搭建了blog,选好了theme。然后今天注册了about.me账号。个人认为about.me做的很不错,简单,美观,符合我的审美。
之前上过校内(人人),豆瓣,新浪,facebook,twitter,linkedin;直到有了属于自己的域名后才感觉真正在internet上安家了。
After googling several posts about how to add and send multiple email attachments using PHP, I found it was uneasy to accomplish it by using the methods from top 20 results on google, either they can show the attachments properly nor can be recognized correctly by gmail. Finally the following codes can correctly add multiple attachments in email.
1. If you want to use array, use the following codes in your html file:
<input type='file' name='uploadedFile[]’ />
Continue reading