Skip to content

Instantly share code, notes, and snippets.

Adrien Lemaire AdrienLemaire

Block or report user

Report or block AdrienLemaire

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
peterbe /
Created Feb 22, 2011
Use these instead of django.forms.Form or django.forms.ModelForm
class _BaseForm(object):
def clean(self):
cleaned_data = super(_BaseForm, self).clean()
for field in cleaned_data:
if isinstance(cleaned_data[field], basestring):
cleaned_data[field] = \
return cleaned_data
View top3stories.js
// Scraping Made Easy with jQuery and SelectorGadget
// (
// by David Trejo
// Install node.js and npm:
// Then run
// npm install jsdom jquery http-agent
// node numresults.js
isaacs /
Last active Apr 8, 2020
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl | sh
You can’t perform that action at this time.