Sep 29, 2014

How To Ask Questions The Smart Way

A must read for everybody.

Sep 28, 2014

Outputting an array with a separator in TYPO3 Fluid

Sometimes you need to output multiple values with a separator and omit empty ones. How do you do it with Fluid?

The following piece of code also uses viewhelpers from an excellent VHS extension.

Jul 17, 2014

What is wrong with these pieces of code?

First:

CREATE TABLE tt_news_cat_mm (
  uid_local int(11) DEFAULT '0' NOT NULL,
  uid_foreign int(11) DEFAULT '0' NOT NULL,

Second:

$selectConf['leftjoin'] = 'tt_news_cat_mm ON tt_news.uid = tt_news_cat_mm.uid_local';
$selectConf['where'] .= ' AND tt_news_cat_mm.uid_foreign IS' .
($this->config['categoryMode'] > 0 ? '' : ' NOT') . ' NULL';


Your opinion?

Jan 27, 2014

If you use Forge&Git for your TYPO3 extension...

If you host your TYPO3 extension on Forge using Git, you need to change URL for your remote. Here is the information from the server team: link.

One additional note: if you need a write access to the repository, you will need a second command.

Direct write access:

git remote set-url --push origin ssh://yourusername@git.typo3.org:29418/TYPO3CMS/Extensions/yourextkey.git

For Gerrit push:

git remote set-url --push origin ssh://review.typo3.org/TYPO3CMS/Extensions/yourextkey

Jan 17, 2014

Speed up Samba share access in OS X

When you connect to external Samba shares on OS X (especially if you use VPN), you may encounter slow speeds. If you do, most likely you connect using smb:// protocol. In OS X Mavericks in the “Connect to server...” Finder dialog try cifs:// instead of smb://. This is many times faster than smb://.

Dec 26, 2013

Fix for Apple's Latvian keyboard layout

Programmers, who use Apple computers with Latvian keyboard layout may find it disappointing that the single quote key is made a "dead key". (Dead keys let you type characters that are not usually on the keyboard, such as ā or š). Single quote is often used in programming, so having it back in the Latvian keyboard layout would be an advantage.

I made a little addition to an excellent KeyRemap4MacBook app, which can remap many keys on the keyboard. My additions include:

  • Change dead key (single quote) back to single quote
  • Change backquote to quote (does not work in Terminal unless you deselect "Use option as meta key" in Terminal's Settings>Keyboard)
  • Use tilde key properly
  • Map Option+Shift+2 to produce a euro sign as on the US keyboard (the default Option+Shift+Q) works as well.

The fix is here. You can install it by pasting the relevant part to your private.xml. See  KeyRemap4MacBook for more information about private.xml.

Oct 31, 2013

Three useful Subversion commands

If you still use Subversion, you may want to know these three commands:

svn diff -c revision

This will show you modifications made in the particular revision.

svn diff -c revision --summarize

This will show you what files were modified in the revision but not the content of the change. Useful if you just need a list of files.

svn merge -c revision source_url wc_path

This will make a "cherry-pick" (hello, Git users!): pick up the content of that revision and merge only it into your working copy.

Oct 30, 2013

OS X lid sleep and Google Chrome

Found a problem on Mountain Lion & Mavericks: if you use Google Chrome, you may experience Macbook Pro sleep issues when closing the lid. It may take several minutes until MacBook goes to sleep. Testing if the issue exists is easy: just keep Chrome running (preferably with heavy content, like YouTube) and close the lid. If the sleep indicator does not start to "breath" in 2-3 seconds, you have the issue. Open it, quit Chrome and try again. You will see that MacBook goes to sleep much faster. Apple Safari has no such issue.

Why this can be a problem for you? Because when you are on the move, you need every bit of power you can scrap from the battery. Even though OS X Mavericks increased battery life for me from 4h to 6.5h, I still prefer to save all the power that my battery has.

So I migrated from Safari. Incidentally, it is faster than Chrome in Mavericks.

Oct 27, 2013

Assigning a backtick key as a shortcut to the Safari Reader

Safari includes a nice feature called "Reader". This is a feature very similar to what Readability extension in Google Chrome do: it takes the main content of the page and presents it for easier reading by stripping all other elements of the web site and changing the font to a big nice and easily readable.

All is good but Google Chrome uses a back tick key for invoking Readability while Safari uses Command+Shift+R, which is much less convenient (try that on your keyboard!). Normally you can change this in the OS X Keyboard settings. The problem is: that panel accepts only keys with modifiers (you cannot have anything without a Command, or Alt, to Control). So how to add a back tick there?

Terminal comes to help (this is one line below!):

defaults write com.apple.Safari NSUserKeyEquivalents -dict-add "Show Reader" "\`"

This command will set the back tick as a reader invoker. Back slash is needed there, it escapes the back tick for the Terminal and will not be a part of the final key sequence.