Hiding ruby gem 'is deprecated with no replacement' messages
I recently installed ruby 1.9.2 via rvm, and suddenly every command started spitting out hundreds of line of deprecation messages : ...
I recently installed ruby 1.9.2 via rvm, and suddenly every command started spitting out hundreds of line of deprecation messages : ...
Rails has a very handy ‘respond_to’ feature to render your pages in different formats : respond_to do |format| format.json { render :json => @user } format.xml { render :xml => @user } format.html end However, by default it outputs every field in the model, which exposes some data (encrypted-password and password-salt) that I’d rather keep to myself : ...
I’ve been playing about with Devise and CanCan for rails authentication and authorization recently - this great pair of posts from Tony Amoyal have helped a great deal. I have a User model and a Role model, and wanted to automatically add the :user role to each user whenever roles are assigned. The roles were set in the controller as follows: ...
This is easy to do, but I always forget how to do it, so this is more a reminder to myself than anything else. To create and checkout a branch in git : ...
To find out if Ubuntu is 32 bit or 64 bit, run uname : uname -m x86_64 = 64 bit i686 = 32 bit
I keep having to look this up to add multiverse repositories (courtesy of tuxicity). ...
If you’re getting 413 Request Entity Too Large errors trying to upload with {{ “nginx.net/” | ext_link: “Nginx”}}, you need to increase the size limit in nginx.conf . Add ‘client_max_body_size xxM’ inside the server section, where xx is the size (in megabytes) that you want to allow. http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { client_max_body_size 20M; listen 80; server_name localhost; # Main location location / { proxy_pass http://127....
If you’re getting missing separator errors in your makefile, similar to the following : Makefile:22: *** missing separator. Stop. … make sure you are using real tabs instead of spaces. A global search and replace for four-spaces should fix things up.
I’ve over-ridden several of the built-in django auth and {{ “bitbucket.org/ubernostrum/django-registration/” | ext_link: “django-registration”}} templates so I can have my own custom-styled login and registration pages. This all worked fine until i tried to run the built-in django and django_registration test suites, when everything fell apart : ...
After spending a few hours struggling to get postfix to work with django on my local dev machine, I gave up and decided to use Gmail . To do it, add the following to your settings.py : ...