Программирование


How to turn off replication on ranning Couchbase cluster

Changing replicas count via REST API or UI is not supported. But there’s unsupported trick that works. Here’s what you can do: wget -O- –user=Administrator –password=asdasd –post-data=’{ok, Config} = ns_bucket:get_bucket(“default”), Map = [lists:sublist(Chain ++ [undefined], 1) || Chain <- proplists:get_value(map, Config)], ns_bucket:update_bucket_props(“default”, [{map, Map}, {num_replicas, 0}]).’ http://localhost:8091/diag/eval Thanks to Aliaksey Kandratsenka

US PyCon 2012 Videos

US PyCon 2012 Videos

PyCon is the largest annual gathering for the community using and developing the open-source Python programming language. PyCon is organized by the Python community for the community. All videos from PyCon 2012 http://goo.gl/IQudF What i found interesting:

Привязываем акаунт пользователя веб-сервиса к Google Analytics

Привязываем акаунт пользователя веб-сервиса к Google Analytics

Основная проблема определения уникального пользователя в GA то что юзер может грохнуть кукисы или зайти под другим браузером/устройством, и при следующем заходе GA подумает что это новый юзер(это бьет нашу аналитику). Что бы этого не было делаем маленькую хитрость)) Основная кука по которой GA определяет уникальность юзера это __utma, которая состоит из таких полей: __utma = [...]

Script for Git that generates changelog by tags

Script for Git that generates changelog by tags: https://gist.github.com/1583550

What to watch – service that helps in choosing movies

What to watch – service that helps in choosing movies

I think many people often ask themselves with the question “What to Watch”. There are many movies and some of them you already watched and some not, so to choose movie that you want to watch can be really hard and take much time.

I was one of this people, and i’m sick of this, so i created service that helps you to choose right movie fester then you can imagine. Checked it on myself and must say it can really save much time.

jQuery Photo Wall from Picasa albums

jQuery Photo Wall from Picasa albums

Trying to recreate Google+ photo wall. Done today most of the things. Some little bugs will fix tomorrow.
Used: jQuery, Google Picasa API

Result of my today work:
http://creotiv.in.ua/examples/photowall/

Python __new__ method magic

Раньше почемуто казалось что метод _new_ в Python всегда должен возвращать инстанс собственного класа. На самом деле это вкорне неверно. Походу или мой склероз прогрессирует или нужно внимательней читать документацию. Эта фича дает реально нехилый буст для красивого АПИ Вот собственно примерчик: class C(object): def __init__(self): print ‘_init_ C’   class A(C): def __init__(self): super(A,self).__init__() [...]

Script for cache invalidation at Amazon CloudFront

This script scans directories that was uploaded to CloudFront and build files index. When you modify some files, script automatically see what files was modified since the last update, and clear cache on CloudFront only for them. Usage: script.py data_dir [index_file] [dir_prefix] data_dir – path to directory with uploaded data index_file – path to files [...]

Bug with estimating user negative feedback rating on Facebook

Due to last mass application deactivtion on facebook, i look at the facebook documentation to see why so much of application has been blocked even if they have good rating and users feedback. First of all i read this facebook blog post http://developers.facebook.com/blog/post/516/ and this https://developers.facebook.com/docs/guides/policy/examples_and_explanations/user_feedback/. If you will take good look at this two [...]

Опасности обучения на Java

«Вы счастливчики. Мы по три месяца жили в мешках из дерюги в грязных сараях. Мы вставали в шесть утра, стирали мешки, съедали по корке чёрствого хлеба и шли работать на мельницу, по 14 часов в день, с понедельника и до воскресенья, и когда мы возвращались домой, наш папа порол нас своим ремнем» — Летающий цирк [...]