Making Windows 8 at least usable

Microsoft is a sinusoid, when talking about Windows releases. It always has perfect system followed by a total mistake and nightmare.

Since Windows 7 was a nearly-perfect system (thousand times better that Vista-joke), then we could expect, that Windows 8, that follows it, will be a nightmare, joke and a total mistake. It is.

While we’re waiting for (hopefully “perfect”?) Windows 9, we need to do something to make Windows 8 at least usable. Because, out-of-the-box, this system isn’t usable and is the shortest path to permanent mental illness. If you can avoid Windows 8, then do it, without asking why. If you’re forced to use it, this article should be a start point for restoring your mental stability.

This is rather a check-list (with some coment), what you should do or at least consider, than fully featured article. And, yes! Everything, what is written here, was tested on Windows 8.1, so should work just perfectly on both Windows 8 and 8.1.

Read More “Making Windows 8 at least usable”

Netbeans-like keyboard shortcuts in Sublime Text 3

I’ve been using Netbeans for over five years. Though it is so deadly slow, I didn’t manage to change to Sublime Text 3 (which is extremely fast) up until now. Five years of constant use of some program causes that you get used to it very hard and you’re very opponent to any changes.

This blog entry is supposed to help you configure Sublime Text 3 in the way as close to Netbeans as possible. But, Sublime Text 3 is not Netbeans. You’re able to achieve a lot of similar functionality (plus a lot more of things that you could only dream about in Netbeans), but there still be a span of things that are not replicable.

Read More “Netbeans-like keyboard shortcuts in Sublime Text 3”

Force Sublime Text 3 to auto-pair quotes before semicolon

By default, Sublime Text 3 will not auto-pair quotes (add closing quote, when you enter opening one), when following character is a semicolon (;). This is a little bit unhandy for PHP developers.

But, since nearly everything in Sublime Text 3, this can be easily tweaked, by changing ST3 configuration.

You’ll find all the details in this wonderful Stack Exchange answer, made by MattDMo after my question asking, how to fix this problem.

Read More “Force Sublime Text 3 to auto-pair quotes before semicolon”

Useful plugins for Sublime Text 3

Sublime Text 3 is powerful and really kicks ass even in its bare installation. But, when you power it up with proper combination of plugins it simply kills entire life on the planet!

Package Control claims to have over 1800 plugins for Sublime Text 3. Browsing this number of them seems impossible. Many of them are abandoned, some are for very specific reasons.

In this article I am only listing just a few plugins that I am using within Sublime Text 3.

If you’re reading this text, I assume, that:

  • you have Package Control installed and
  • you’re after reading my Beginning with Sublime Text 3 article.

If not, skip back and pass these two points.

Read More “Useful plugins for Sublime Text 3”

non-YiiBooster fields with YiiBooster prepends

I don’t like the idea of rewriting my entire application’s view to use new Bootstrap 3, so my Yii apps remain on Bootstrap 2, served by YiiBooster extension. The biggest problem, I find in it is that its controls have prepends somehow “built-in”.

Both field and its prepend is rendered with one line of code. So, when you want to replace any YiiBooster’s control with for example own widget / library, you always remove one line, but looses both field and prepend.

I found ugly and nasty workaround for this.

Read More “non-YiiBooster fields with YiiBooster prepends”

ALWAYS check manufacture date of the battery, you purchase!

I have put my own and Izzy‘s answer on Android Stack Exchange to formulate this check-list or rather list of importance for things that you should consider when purchasing a new battery.

tl;dr: Li-Ion batteries stored in store or warehouse without cyclic re-charging (which most likely never happens in these scenarios) are completely dead after 20 months at most. Thus, you should never, ever purchase any kind of battery that is two years old or more. No matter what seller says.

Read More “ALWAYS check manufacture date of the battery, you purchase!”

CTags and Goto source definition in Sublime Text 3

One of the most important functionality of each high class IDE is “Goto source definition” mechanism, which let you click particular symbol (i.e. class or method name) in any source file of your project and be immediately redirected to file (and line) that contains its definition.

Sublime Text 3 is not supporting this functionality natively. But, we can add it quite easily, using CTags plugin.

Read More “CTags and Goto source definition in Sublime Text 3”

Cyclic jobs in Yii and MySQL

When we are talking about some cyclic tasks executed periodically in PHP, most of us automatically thinks about CRON. It is not surprising, since it is very popular, easy to manage (available often even on shared hostings) and easy to code (it simply fires given PHP script).

However, there are four other ways you can achieve exactly the same in Yii/PHP. And many Yii developers may not be aware about some of them.

Read More “Cyclic jobs in Yii and MySQL”

Remove “Edit with Notepad++” option from context menu

One of the newest updates of Notepad++ has introduced new, quite annoying Edit with Notepad++, item added to many context menus. Since, there isn’t an option in Notepad++ itself, to remove it, you have to solve the problem yourself, by unregistering one of Notepad++ services.

There’s a solution that:

  • doesn’t require you to tweak with the registry or
  • download and install or run any program.

All you need is to use a command line in administrator mode and follow five quite simple steps.

Read More “Remove “Edit with Notepad++” option from context menu”

SublimeCodeIntel and Code intelligence in Sublime Text 3

There’s an article about using CTags plugin to implement “Goto source definition” functionality in Sublime Text 3 — a mechanism, which let you click particular symbol (i.e. class or method name) in any source file of your project and be immediately redirected to file (and line) that contains its definition. You’ll find it here: “CTags and Goto source definition functionality in Sublime Text 3“.

This functionality is often called “Code intelligence” and there is another plugin — SublimeCodeIntel — that implements it in Sublime Text 3. If you want this kind of functionality in Sublime Text 3, but don’t want to use CTags plugin, this article will tell you more about alternative to it.

Read More “SublimeCodeIntel and Code intelligence in Sublime Text 3”

Working with code snippets in Sublime Text 3

This is another article about my transition from Netbeans to Sublime Text 3. This time I’m going to handle code snippets topic. This is another area, which is much better solved in Sublime Text 3 than in Netbeans.

This article is generally based on “Working With Code Snippets In Sublime Text” blog text from hongkiat.com. And — of course — wonderful, yet unofficial Sublime Text documentation’s chapter about snippets. With some my personal additions and updates.

Read More “Working with code snippets in Sublime Text 3”

Useful keyboard shortcuts in Sublime Text 3

This is the last article in my private serie of blog entries targeting developers, who starts their journey with Sublime Text 3. Treat it as memo or list for easy remembering sometimes very useful, not always often, keyboard shortcuts, that are available in ST3. Where it is possible, I’m adding links to Sublime Text Unofficial Documentation, which is great source of information in any aspect related to Sublime Text 3.

Note, that entire document is based on default Sublime Text 3 key bindings, before any user changes, like for example those mentioned in [Netbeans-like keyboard shortcuts in Text 3.txt] text. Also note, that when speaking about Alt key, I’m referring to left key. As on some non-English keyboards, right Alt key may have different meaning (entering language-specific letters etc.)

Multiple cursors and selections

Sublime Text 3 allows you to edit text in more than one place at once, using multiple cursors. Simply hold Ctrl key, click in two or more places to set multi cursors. Then start typing anything and observe the effect of text being entered in all these positions simultaneously. Click anywhere without Ctrl pressed to “reset” back to one cursor mode.

You can also use multiple selections. Select some text and press Ctrl+D to select next instance of the very same text, as in current selection. Continue pressing Ctrl+D to move forward and select following instances of selected text. Press Ctrl+U to move backward, unselecting each previously selected instance. Press Ctrl+K and Ctrl+D to skip current instance and move to the next one.

If you wish to select entire line, press Ctrl+L.

There are few useful keyboard shortcuts for quick selection expanding. Ctrl+Shift+Right or Ctrl+Shift+Left traditionally (as in many editors) spans selection over next or previous word. Alt+Shift+Right and Alt+Shift+Left does the same, but they operate of “subwords”, which means — will stop also on underscore (_), which is very useful for selecting variables, symbols etc. Previous set of shortcuts stops only on spaces, so in the word this_is_an_example it will expand selection for the entire word at once, while Alt+Shift and arrows will expand on each of these “subwords” respectfully.

Pressing Ctrl+Shift+M will select entire text inside current brackets. Used mostly, when cursor stands next to the opening bracket, to expand selection all the way to the closing bracket. But, can be used also in any place between two brackets.

Ctrl+T is used by default for transposing (swapping together) two letters or two words. But, if you installed CTags plugin (more about in this article, then this shortcut will be overridden by that plugin for its base functionality. You must define your own for transposing or redefine CTags’s shortcut to use these two functionalities together. Read [Netbeans-like keyboard shortcuts in Text 3.txt] to find out more about key bindings in Sublime Text 3 and for examples of user-defined keyboard shortcuts.

Searching and replacing

When search box (Ctrl+F) is opened, you can use both F3 and Enter to move to the next search result (found text instance) and both Shift+F3 and Shift+Enter to move back to previous one. If search box is hidden, but search query defined, you can use only F3 / Shift+F3 shortcuts. With the same logic, you can use both Alt+F3 and Alt+Enter to select all instances matching current search criteria, when search box is open, or only first one, if it is closed.

You can use Ctrl+Shift+H to replace currently selected instance of search criteria with given replace pattern and move and select following one (if nothing is selected, it selects nearest instance, but not replaces anything with first pressing of this shortcut). You can also use Ctrl+Alt+Enter to replace all instances at once. These two shortcuts works no matter, if replace box (Ctrl+H) is open or closed.

Hit Esc to dismiss both search and replace pane.

Other shortcuts

Press Ctrl+0 to focus sidebar, to be able to use it (navigate through files and folder) with just your keyboard. Hit Esc to go back to the editor.

Beginning with Sublime Text 3

My journey started with reading (and watching videos) two good blog entries done by Stuart Herbert:

However, both texts are old and covers Sublime Text 2 only. And both are quite long. If you want a shorter version, updated for Sublime Text 3, then read on…

Note, that this article is filled with many comparisons to that Netbeans. Intentionally. I’ve been using Netbeans for past five or more years. And from the first day, I started using Sublime Text 3, I feel like I’m a newborn developer again. And I finally have super-fast, super-powerful IDE instead of old, slow, buggy, cranky Java-based Netbeans. Whoa! :]

Read More “Beginning with Sublime Text 3”

Changing sidebar’s font size in Sublime Text 3

Changing font size of editor (by adding "font_size": 14 for example to Preferences > Settings – User file) changes font size of editor area. But leaves font size of sidebar unaffected. I have found files and folders’ names, drawn on sidebar with 10 pt font size, quite not so comfortable on Full HD resolution screen.

So, I needed a fix.

There’s (of course!) a Stack Overflow answer, that explains, how to achieve this in Sublime Text 2. I managed to port this solution to Sublime Text 3.

Read More “Changing sidebar’s font size in Sublime Text 3”

Migrate PuTTY sessions between computers

PuTTY is one of the first programs, that I install on every computer. Since, it stores sessions in registry, it is a bit difficult to migrate sessions between computers. So far, I manage to do this with a little bit help of regedit.exe program and guides like this one. Today, unfortunately, I hit the wall, when my brand new installed Windows 7 told me, that it can’t merge entries from my putty.reg file, because it can’t access Windows Registry.

Read More “Migrate PuTTY sessions between computers”