Python styles guide (PEP 8) in Pdf and Docx

There is no doubt that following general conventions is “must have” for developers for any developers. I like read most of documentation for PLs on iPad and sometimes without internet connection. I could not find any good pdf version of styles for Python to read on tablet offline and so I decided to make it by myself. Now I am going to share with you *.docs and *.pdf doc versions I created.
The original document you can find here:


Amazon Elastic Beanstalk: add/change php.ini settings

Hi folks,

I’m going to tell you how to add (or change/rewrite) settings for php.ini if you deploy your project on elastic beanstalk. I need to change two values in php.ini upload_max_filesize and post_max_size.

To start with, need add directory with name `.ebextensions` and add file there with some meaningful name with trailing `.config`. I created `phpini.config` file

Continue reading “Amazon Elastic Beanstalk: add/change php.ini settings” »

Switch off MySQL autostart on Mac OS

My operation system is Mac OS 10.6 and I’ve installed MySQL sometime ago. I need the database but I don’t like when it works all the time.

So, to turn off autostart for MySQL need:
#1 Open file /etc/hostconfig with sudo privileges, for example with vi editor
#2 Chnage line from “MYSQLCOM=-YES-” to “MYSQLCOM=-NO-”

The location of original script that launch the DB server at startup is /Library/StartupItems
But this is only for your information no need to change something there.

Cookie in Javascript

Http protocol is stateless, so there is no native way to save some information between pages. But fortunately we have cookie in browsers.

First of all, how to check if browser supports cookie:

var isCookieEnabled = navigator.cookieEnabled;
alert(isCookieEnabled ? 'Cookie Enabled' : 'Cookie Disabled')

And when you checked that cookie works need to use the cookie storage. The easiest way is to use jQuery plugin for this Read how to use jQuery Cookie plugin

Javascript’s foreach

Javascript doesn’t have foreach statement, but it’s simple to emulate one:

<script type="text/javascript">
var arr = ['one', 'two', 'three', 'four', 'five', 'etc'];
for (var i in arr) {
	var element = arr[i];
	alert(i + ': ' + element);

It’s actually equivalent of foreach in other languages like PHP.
If you have jQuery on your webpage you can use jQuery’s foreach:

<script type="text/javascript">
var arr = ['one', 'two', 'three', 'four', 'five', 'etc'];
jQuery.each(arr, function(index, element) {
	alert(index + ': ' + element);