30 Jun, 15

Creating Custom Template Filter That Injects Adsense Ad Code After N Paragraph in Django

Injecting ads inside content is a very effective technique. Let's say you want to inject Adsense ad after the first paragraph of text. To add such capability to our Django-based website we need to create a custom filter for that. I'll tell you how to implement such a filter.

1 ...

Read now
04 Jun, 15

Elasticsearch fails with error "This can result in part of the JVM being swapped out. Increase RLIMIT_MEMLOCK (ulimit)". What to do?

Well, basically, that means you have too low memlock limit setting in your OS. This can be easily fixed in two steps:

1) Edit /etc/security/limits.conf file and add to the end:

1
2
  1. * hard memlock unlimited
  2. * soft memlock unlimited

2) Add a line in the /etc/pam ...

Read now
06 May, 15

Running Django manage.py commands from anywhere

One of the most annoying aspects of developing in Django for me is running manage.py commands: you need to be in the same directory with manage.py file in order to run a command. This is not convenient. I thought it would be cool to be able to run ...

Read now
01 May, 15

Installing libsass (django_libsass) on Mac OS Yosemite

I started playing with wagtail recently (a very promisiing Django CMS) and they use django_libsass to compile their sass into css. Unfortunatelly, if you'll try to install django libsass via PIP on Mac you'll get a compile error message. I tried lots of approaches to fix this and it didn't ...

Read now
30 Apr, 15

Install npm packages without sudo

If you run the following command to install npm package:

1
  1. npm install <package_name>

and get an access error, you might be tempted to run this command with sudo and it'll work, but it's not a right way for sure. Npm modules should be installed without sudo. To fix the ...

Read now
29 Apr, 15

Saving file field uploads not in MEDIA_ROOT directory

I had a requirement recently to upload files to some kind of a private directory, not accessible via www. Of course, I used Django model's FileField to solve the task, but the problem was in a fact that by default, FileField saves uploads under MEDIA_ROOT which is not what I ...

Read now
20 Apr, 15

Happy birthday to me and Devel form debug module to you all

I’m turning 32 today. People love birthdays, to me it’s just another line number in a messed stack trace output (philosophy mode enabled).
 
Two years ago I released a drupal module called Get form id (deprecated from now on) that does one small task - it tells you any form's id ...
Read now
09 Apr, 15

If Your Ionic + Android / Crosswalk App Has Stopped Getting Data From a Remote Server Then Read This

If you've enabled crosswalk browser for your Ionic based Android app and it suddenly stopped getting data from requests sent via $http that means that you've been automatically upgraded to Cordova 4.0 and in this version Cordova implements a whitelist policy for navigating the application webview via external plugin (before that ...

Read now
19 Mar, 15

Improve Ionic's Performance in Android With Native Scrolls

Does your Ionic app feel sluggish on scrolls in Android? Well, there's a way to cure that. Ionic has introduced native scrolls in its latest release. In short: native scroll disables Ionic's JS scrolling and releases CPU by handing over the scrolling task to the OS ie Android. As a result ...

Read now
31 Oct, 14

First Steps To Do When You Start A Project With Ionic

Here are the first steps I do when I start developing a mobile app with Ionic Framework. Ionic has a great getting started page where the main steps are perfectly described, but I usually do a little bit more of a setup. Here's my routine:

1) Install Ionic (if you ...

Read now