-rw-r--r-- 1.8K Aug 13, 2014 · 0B5B06B · ~2 min

node-couchdb-mover

node.js couchdb полезное

node-couchdb-mover

A few days ago I wrote my first Node.js tool. I wrote it only partly for myself, because for me it is not very relevant yet, but for some people it very much is.

The tool is for CouchDB. Since CouchDB keeps document revisions after changes and deletions and does not always clean them up, a database can grow like crazy. For example, for the guys who need this tool right now, something that should weigh 6 GB weighs 50-60. Maybe they started something somewhere or messed something up, changed and wrote a ton of stuff into the database, and that blew up its size. So, overall, it is easier to just create a new clean database and move all live documents there.

The tool simply takes all documents from 1 database in CouchDB and puts them into another one. For now it works rather crudely: it grabs all documents in one shot and then inserts them into the database one by one. For databases with a relatively small number of documents it works fine, but if there are something like 80 thousand documents, fetching them on my computer took about 4-5 minutes. So I will rework it soon so that it pulls documents in batches and writes them to the database sequentially instead of asynchronously.

But it is already usable. You can embed the tool into your own Node.js project, for example.

In the console:

npm install node-couchdb-mover

In code:

var mover = require('node-couchdb-mover');
mover.moveDocuments('dbName1', 'dbName2');

It can also be used directly from the console:

npm install -g node-couchdb-mover
couchdb-mover --from=dbName1 --to=dbName2

And, as expected, here are the sources on GitHub and the package on npmjs.org.

[↵] open page node-couchdb-mover.md
-rw-r--r-- 826B Jul 3, 2014 · 770754A · ~1 min

How to tell whether a display is Retina or not?

retina баловство полезное

How to tell whether a display is Retina or not?

My blog gets a lot of search-engine traffic for queries like “How to detect a Retina display”. People land on my article about Objective-C, but they are clearly not looking for code :) So I ended up making a page like this one: you just open it in the browser on your device. If it is Retina, the result is green, like in the screenshot above. If it is not Retina, it is red, like in the screenshot below.

How to tell whether a display is Retina or not?

It works for iOS devices (iPhone, iPad, iPod) and Macs with a Retina display. On screens with a high pixel density it also says Retina :)

Page URL: https://arm1.ru/retina/

[↵] open page kak-uznat-retina-displej-ili-net.md
-rw-r--r-- 2.6K Jul 2, 2014 · 694B598 · ~2 min

Linode client for iPhone

linode ios приложения

I have been using Linode.com hosting services for several years now. That is where I keep my VPS with sites / projects and for various personal purposes.

They have an API, and as far as I understand, they built an iPhone client on top of it.

The client looks like it was just reskinned.

Linode client for iPhone Linode client for iPhone

[↵] open page klient-linode-dlya-iphone.md
-rw-r--r-- 523B Jun 9, 2014 · 14CA55D · ~1 min

Cheat sheet for setting up nginx+php-fpm from Homebrew

nginx php-fpm шпаргалки

If after configuring nginx and php-fpm to work through php5-fpm.sock, Nginx throws a 502 bad gateway error and the log contains something like this:

*20 connect() to unix:/usr/local/var/run/php5-fpm.sock failed (2: No such file or directory) while connecting to upstream

Then the permissions problem can be fixed like this:

cd /usr/local/var/run
sudo chmod 666 php5-fpm.sock

If that helped, then in /usr/local/etc/php/5.5/php-fpm.conf you should also uncomment this line:

listen.mode = 0666
[↵] open page shpargalka-pri-nastrojke-nginx-php-fpm-iz-homebrew.md
-rw-r--r-- 7.2K May 22, 2014 · 6AB0DD9 · ~5 min

Writing a Yandex.Metrica Client for iPhone

objective-c ios айметрик

iMetrik

A copy of my article from Habr

[↵] open page pishem-klient-dlya-yandeks-metriki-dlya-iphone.md
-rw-r--r-- 471B Apr 22, 2014 · C3CA7C6 · ~1 min

iMetrik 1.1 Update

айметрик ios приложения

iMetrik 1.1 Update iMetrik 1.1 Update iMetrik 1.1 Update

Today the iMetrik update was released. The main additions are the Visitors tab with reports by gender, age, and geography, and the Goals tab, which contains all the same reports but for goals and with additional parameters such as goal achievement, conversion, and more.

Also fixed a couple of issues.

[↵] open page obnovlenie-ajmetrik-1-1.md
-rw-r--r-- 901B Apr 17, 2014 · 9BB67AD · ~1 min

iSubscriptions — Yandex.Subscriptions Client for iPad

айподписки ios приложения

iSubscriptions — Yandex.Subscriptions Client for iPad

I had wanted to write this app for a long time. Strangely enough, in the eight months since Yandex opened the API for Yandex.Subscriptions after Google Reader was shut down, not a single iOS client had appeared. And I wanted such an app for myself as well. I started reading news at home with a cup of tea, then continued on the road on my iPad — everything I had already read was marked as read, beautiful. And in general it is simply more convenient for me to read news on the iPad. Somehow the web version of Subscriptions does not work particularly fast.

In the app you can not only read news and share it on social networks or add it to Safari Reading List, but also manage subscriptions — add new feeds and remove the ones already added.

If there is no app, write it yourself :) The app is free.

[↵] open page ajpodpiski-klient-dlya-yandeks-podpisok-dlya-ipad.md
makoni@arm1:~/blog$ cd ../page-19/ // ← previous cd ./page-21/ // more posts →