Alex Zeitler

No more leaky abstractions.

Ctrl+Tab to switch between Windows in OS X Application

If your OS background is Windows, you’re used to use CTRL+TAB to switch between the Windows inside an application. In OS X this doesn’t work and some people even suggest to buy third party tools. But there’s a simple solution inside the OS X Keyboard settings:

  • Open Keyboard settings
  • Select “Keyboard & Text Input”
  • Find “Move focus to next window”
  • Double click the current keyboard shortcut
  • Change it by hitting CTRL+TAB on your keyboard

image

Btw: CTRL+TAB doesn’t work in Sublime. You have to edit your .sublime-keymap (SHIFT+CMD+P -> “Key Bindings - User”) and paste this:

1
2
3
4
[
   { "keys": ["ctrl+tab"], "command": "next_view" },
   { "keys": ["ctrl+shift+tab"], "command": "prev_view" }
]

Restarting node.js server automatically when source code changes

During development, you’re constantly changing your source files. Normally that would require you to call something like

1
$ node server.js

everytime you change one of your source files.

A simple workaround is to

1
$ sudo npm install supervisor -g

Now you run

1
$ supervisor server.js

Only once and everytime your source code changes, your development server gets restarted by supervisor automatically.

Convert SVG to PNG on OS X

If you need to convert .svg files to .png, there’s a handy command line tool that comes with OS X: qlmanage.

To convert my.svg file to my.png having a width of 1000px just run

1
qlmanage -t -s 1000 -o . my.svg

git push prompts for UserName and Password on GitHub

If git push origin master prompts for you UserName when <origin> is on GitHub, you may need to fix your origin url, e.g.

1
git remote set-url origin git://github.com/AlexZeitler/node-hands-on.git

The correct url is the GitHub url with read/write access (you get it if you click the SSH button): image

My OS X findings

As I already told you, I’m pretty new to the OS X platform and I’m always looking for tools to get the daily work done.

The following list shows you the tools I’ve found or that have been recommended to me (this list will be updated from time to time, so you can bookmark it ;-))

development

editor

launcher

MongoDb

productivity

shell

usability

  • Shift it Windows 7 like Window docking (left/right etc.)

rake generate for octopress fails with invalid byte sequence in US-ASCII (ArgumentError)

If you’re receiving an error similar to this

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[~/Documents/alexzeitler.com]$ rake generate         [source][ruby-1.9.2-p290] 
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from /Users/alex/Documents/alexzeitler.com/_config.yml
Building site: source -> public
/Users/alex/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/convertible.rb:29:in `read_yaml': invalid byte sequence in US-ASCII (ArgumentError)
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/post.rb:39:in `initialize'
  from /Users/alex/Documents/alexzeitler.com/plugins/preview_unpublished.rb:23:in `new'
  from /Users/alex/Documents/alexzeitler.com/plugins/preview_unpublished.rb:23:in `block in read_posts'
  from /Users/alex/Documents/alexzeitler.com/plugins/preview_unpublished.rb:21:in `each'
  from /Users/alex/Documents/alexzeitler.com/plugins/preview_unpublished.rb:21:in `read_posts'
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:128:in `read_directories'
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:98:in `read'
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/lib/jekyll/site.rb:38:in `process'
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/gems/jekyll-0.11.0/bin/jekyll:250:in `<top (required)>'
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/bin/jekyll:19:in `load'
  from /Users/alex/.rvm/gems/ruby-1.9.2-p290/bin/jekyll:19:in `<main>'

when running rake generate for octopress, add this to your .profile or .zshrc etc.

1
2
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

This application requires a version of Adobe AIR which cannot be found

If you’re receiving this message, when trying to install Adobe Air on OS X:

image

You’ll need to disable automatic graphics switching in the Energy Saver settings:

image

If you experience problems with an Air based application (like Balsamiq Mockups) during runtime, you should try this also…

Permission denied (publickey) when trying to access repository on GitHub

If you already own a GitHub account and try to clone from or push to a repository on GitHub you may receive a

1
Permission denied (publickey)

error.

This may be the case if you have set up a new machine without having installed your existing ssh key properly.

To do so, just copy your private key to your ~/.ssh directory and call:

1
$ ssh-add ~/.ssh/id_rsa

whereas id_rsa is the name of your ssh key.

Another reason why you fail, may be a missing .config file in your ~/.ssh folder.

If this is the case, just create it and paste the following into it:

1
2
3
4
5
6
7
Host github.com
  User git
  Port 22
  Hostname github.com
  IdentityFile ~/.ssh/id_rsa
  TCPKeepAlive yes
  IdentitiesOnly yes

Hello (from a new) World

Yet another blog?

If you know my blog Alex on ASP.NET, you may ask why I started blogging on another Url and a different blog engine?

As you may have noticed on Twitter, besides ASP.NET MVC and WCF Web API, I started developing mobile-first and single page web applications using HTML5, CSS3 and Javascript a few month ago.

Most of the Javascript and CSS3 frameworks (not least node.js) have their background in the OSS community which is mainly focused on Linux and OS X.

To have that technology stack available just in time (and sadly often long before being available on the Windows stack) for my daily work, I decided to step out of the comfort zone / think outside the box (name it whatever you want) and use both platforms on a daily basis also.

What to expect?

As I’m pretty new to both OS X and Linux (read: Ubuntu), I’ll post about my experiences during my way to the “x world” (not least as a documentation for myself if I forgot about something I already solved).

That means I’ll document which languages, tools and frameworks I’ll use, what I (dis)like on the “new” platforms etc.

Will you leave .NET / the Microsoft stack?

Short answer: No.

Long answer: World is changing fast and a developers (geeks) world even faster and as much as I like ASP.NET MVC and Web API: it’s simply on the server side and much things nowadays happen solely on the client (read: client == browser != classic desktop).