Мыслепомойка

Java, Ruby, git, MacOSX

May 31, 2010 at 12:16pm

Notes

Тур Хейердал. Путешествие на “Кон-Тики”

История просто невероятная. О том как группа малознакомых людей пересекли Тихий океан на плоту! Когда-нибудь обязательно перечитаю. Очень лёгкая и интересная книга.

April 19, 2010 at 10:39am

Notes

K. Adlard Coles - “Heavy weather sailing”

I like everyting about wind/weather/sea/sky :)

March 16, 2010 at 8:46am

Notes

Import Google Chrome bookmarks to Safari

I wanted to import Chrome bookmarks to my Safari and faced with such hurdle - there is no way to do it using native chrome/safari functionality. So I’ve implemented ‘fast and dirty’ solution that works for me.

  1. Upload Google Chrome bookmarks file (it is somewhere at ~Library/Application Support/Google/Chrome/Default/Bookmarks, if it is located in other please, let me know - I’ll mention it here)
  2. Open Safari->File->Import Bookmarks
  3. That’s it!

If this doesn’t work for you - give me a sign, I’ll try to find a time and fix it!

Here is a ruby code behind:

March 14, 2010 at 10:21am

Notes

Getting Real - The smarter, faster, easier way to build a successful web application

Amazing reading. Nice typography. This work is written with a great passion. It is about only things that matter. It looks like a compilation of good, refined thoughts and qoutes.

That is why I really like it: “When you solve your own problem, you create a tool that you’re passionate about. And passion is key. Passion means you’ll truly use it and care about it. And that’s the best way to get others to feel passionate about it too.”

This book is an evidence of the power of passion.

March 5, 2010 at 10:18am

0 notes

On usability conventions

I’m using MacOSX for three or so years and still admiring its beautiful interfaces and elegance. I have no GTK/WxWidget/QT and other applications. Most of OSX applications use native UI toolkit or at least look like native. And most applications do behave as expected.

But sometimes I feel gauged. This happens when I need to switch between tabs in some applications. To siwtch using keyboard shortcut. And here I get confused.

Here is a comparition table of applications I often use:

So I have three application with absolutely different and non-intersecting tab-switching shortcuts. But browsers do behave as expected on two common keybindings.

People developing browsers think on how the end user will switch between tabs, I mean they try to forsee what she would be comfortable with, and as result we have tha every browser supports most used shortcuts.

We really have to have a standart for tab-switching shortcut. Because it is a nightmare when you switch from browser to any other app and sitting and trying to remember how to walk between tabs in _this_ application. And can you imagine what a pain is daily using of Skype/Adium/Textmate/Google Chrome together?

March 4, 2010 at 10:51am

0 notes

A simple way of creating Sinatra applications on Heroku

I’ve just pushed Sinatra project template that could be used on Heroku environment. Here is a usage case:

git clone git@github.com:dashin/sinatra-heroku-template.git
mv sinatra-heroku-template YOUR_PROJECT_NAME
heroku create YOUR_PROJECT_NAME
cd YOUR_PROJECT_NAME
git remote add heroku git@heroku.com:YOUR_PROJECT_NAME.git
git push heroku master
git remote rm origin

Any comments are highly appreciated!

February 15, 2010 at 2:56pm

Notes

Gistamine - gist.github.com Chrome extension

Today I’ve released the first version of Google Chrome extension called Gistamine. I hope it could be usefull for anybody. Here some screenshots:

Project source is located here: http://github.com/dashin/gistamine. To install visit the project’s details page. Feel free to contact me with any suggestions.

February 13, 2010 at 11:00pm

0 notes

JavaScript Casting to Number Quiz

Today I was playing with JavaScript again, and as result a small quiz was born. Hope you’ll enjoy.

  1. var i; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined
  2. var i = null; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined
  3. var i = {}; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined
  4. var i = ""; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined
  5. var i = "0"; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined
  6. var i = "a"; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined
  7. var i = false; alert(++i);
    1. Error
    2. 1
    3. NaN
    4. undefined

Answers:

  1. NaN (undefined + number == NaN)
  2. 1 (null is casted to 0)
  3. NaN (object + number == NaN, except nulls)
  4. 1 (empty string is casted to 0)
  5. 1 (string “0” is casted to 0)
  6. NaN (string with not a number is casted to NaN)
  7. 1 (booleans are casted to numbers: false to 0 and true to 1)

February 12, 2010 at 7:47pm

0 notes

Парни в коде ковырялись -
Десять багов там нашли
Целый день они ебались,
И на митиг не пошли

— Me

12:29pm

0 notes

Small bookmarklet for StackOverflow.com

Like most of StackOverflow regular users I have Interesting and Ignored tags. But when I ignore something, I don’t want to see it at all. So, I’ve made the following bookmark:

Name: StackOverflow.strip!
Address: javascript:%20$(“.question-summary.narrow:not(.tagged-interesting)”).remove();$(“.tagged-ignored”).remove()

And now when I open StackOverflow, it looks like this:

Then I click on my bookmarklet, and ta-da:

In the bookmarklet I’ve used JQuery due to StackOverflow uses JQuery.