Saturday, October 29, 2011

'Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.' error in MacVim (Janus)

After launching MacVim you may get this annoying error message:
'Taglist: Exuberant ctags (http://ctags.sf.net) not found in PATH. Plugin is not loaded.'

To remove this you have to install ctags which you can download from http://ctags.sf.net.
After you unziped it, you have to set the Tlist_Ctags_Cmd variable in the .vimrc file to point to the ctags folder.

let Tlist_Ctags_Cmd = '/usr/local/bin/ctags'

After that you have to restart vim and the message should not pop up again.

Tuesday, October 25, 2011

Launching MacVim from Command line

Put this into your .profile or .zshrc file
function mvim { /Applications/MacVim.app/Contents/MacOS/Vim -g $*; } 

Then you can use 'mvim' in the command line.

The full explanation is in the MacVim Google Groups

Tuesday, September 27, 2011

Simulating slow network connection in OSX

Setup
sudo ipfw pipe 1 config bw 16Kbit/s delay 350ms

sudo ipfw add 1 pipe 1 src-port 80
sudo ipfw add 2 pipe 1 dst-port 80


Remove
sudo ipfw delete 1
sudo ipfw delete 2

sudo ipfw pipe 1 delete

Wednesday, September 21, 2011

Disable spotlight

Disable Spotlight
sudo mdutil -a -i off

Enable Spotlight
sudo mdutil -a -i on

Tuesday, September 20, 2011

Tapping on <label> in Mobile Safari

Tapping on <label> does not auto-focus linked in Mobile Safari but If we add an empty function as clickhandler it works fine.

<input type="checkbox" id="test" name="test">
<label for="test" id="test_label">This is the label</label>
<script>
document.getElementById("test_label").onclick = function () {};
</script>

This is the releated Stackoverflow discussion.

Thursday, September 8, 2011

Checkbox/Radio button size on Android Safari

You cannot change checkbox/radio button width/height on Android in Safari because it is tied to the OS.

But since the default ones are so tiny that you may need bigger buttons.
Here is a simple trick:

input[type=checkbox] {
-webkit-transform: scale(2,2);
}

Please note that if you set up values bigger than ~2 then the yellow outline will look weird.

Friday, July 29, 2011

Get links from a page with bash

Get anchor elements from a webpage can be done with

curl URL 2>&1 | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2


where you replace URL with your choice, just like here:
curl http://cookpad.com 2>&1 | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2