Skip to content
My path through nerd matter

A nerds discoveries

My path through nerd matter

Shrunk Expand

Primary Navigation

  • Home
  • About
Newer posts→
  • Prompt with git branch

    Posted on November 10, 2010 16:22 by robert Comment

    I think I like this:

    [cc lang=”bash”]
    function parse_git_dirty {
    [[ $(git status 2> /dev/null | tail -n1) != “nothing to commit (working directory clean)” ]] && echo “*”
    }
    function parse_git_branch {
    git branch –no-color 2> /dev/null | sed -e ‘/^[^*]/d’ -e “s/* \(.*\)/[\1$(parse_git_dirty)]/”
    }

    export PS1=’${debian_chroot:+($debian_chroot)}\[\033[01;33m\]\w\[\033[01;32m\] $(parse_git_branch) \[\033[01;36m\]$ \[\033[00m\]’
    [/cc]


    📂This entry was posted in git
  • Thunderbird 3 account setup tip

    Posted on October 16, 2010 09:06 by robert Comment

    Wish you could set up an account in Thunderbird manually?

    You’re not alone.

    The trick: Hit the “stop” button as soon as you enter the automatic setup window and set your settings manually. If you wait to press “stop” it will not stop and the best thing you can do is to cansel and start over again.

    Ref: http://www.givesatisfaction.com/mozilla_messaging/topics/can_t_setup_an_imap_connection_in_thunderbird_3


    📂This entry was posted in Uncategorized
  • Fix to vims taglist plugin (ctags tags comments in PHP)

    Posted on January 31, 2010 22:58 by robert 6 Comments

    Taglist uses exuberant ctags, which supports many languages including PHP. I use vim on a daily basis to edit PHP files. Often classes and functions have PHPDoc and some like to use the words ‘class’ or ‘function’ in their comments. Fair enough, but ctags regex strings ignores that lines may have a preceding ‘*’ or ‘//’ and thus create tags of funny classes and functions. In some cases browsing large files of PHP source code with taglist is pointless.

    The solution to this is writing your own ctags configuration file (~/.ctags) and letting ctags know what regex strings You want to tag your PHP files with:


    -f ./tags
    --langmap=php:+.inc
    -h '.php.inc'
    -R
    --totals=yes
    --tag-relative=yes
    --PHP-kinds=+cf-v
    --regex-PHP
    --regex-PHP=/(^|^[^*]+[[:blank:]])class[[:blank:]]+([[:alpha:]][[:alnum:]_]*)/\2/c/
    --regex-PHP=/(^|^[^*]+[[:blank:]])function[[:blank:]]+&?[[:blank:]]*([[:alpha:]][[:alnum:]_]*)/\2/f/


    📂This entry was posted in Vim
  • MyPasswordSafe to KeepassX converter

    Posted on January 5, 2010 14:33 by robert Comment

    I’ve used MyPasswordSafe for some time, but after I installed Kubuntu Karmic Koala AMD64 it would’nt start. I googled the Internet for a better program and settled with KeepassX.

    Next trouble was to move my passwords from MyPasswordSafe to KeepassX. Both programs can export/import XML files, so I made a PHP file that did the job. I even created a project on githut for it.


    📂This entry was posted in PHP 📎and tagged keepassx mypasswordsafe php xml convert
  • Customer spesific settings in vim using git branches

    Posted on September 8, 2009 05:58 by robert Comment

    I work as an consultant and thus write code for different customers that may have quite different coding standards and license policies. Adapting to a customer often involves changing many files in the vim config files and plugins, but after I initialized a git repo in my ~/.vim folder I only have to change branch for each customer I work for. git br (git branch) gives me a neat list of predefined customer settings to choose from. Then its just git co [customer] and start to work.


    📂This entry was posted in Vim
  • Back in time with Vim

    Posted on August 24, 2009 14:27 by robert Comment

    My college came by my desk today wanting to know how to go back in time with vim. He had been undoing and redoing a lot and suddenly realised he had messed up his buffers. I had never heard about going back in time with vim, but Google had the answer on this post: lifehacker.com/202093/go-back-in-text-file-time-with-vim-70.

    Apparently the past is but a :earlier 10m away!


    📂This entry was posted in Vim
  • Import contacts from Zimbra and Google to Thunderbird

    Posted on July 18, 2009 09:05 by robert Comment

    This is simple thanks to the Zindus extension to Thunderbird.


    📂This entry was posted in Uncategorized 📎and tagged thunderbird contact zimbra google
  • How to enter coordinates in Google Maps on your HTC Magic

    Posted on July 11, 2009 23:24 by robert 2 Comments

    As stated in this blog post, you can just enter the coordinates like this:

    37 57 11.98 N 121 05 15.76 W


    📂This entry was posted in Uncategorized
  • Backwards compatible PHP constructors

    Posted on April 3, 2009 12:05 by robert Comment

    PHP5 is more backwards compatible than I excepted.


    📂This entry was posted in PHP 📎and tagged constructors
  • PHP frameworks

    Posted on December 27, 2008 10:15 by robert Comment

    Today I came across a site that “compare all kinds of PHP Frameworks”: www.phpframeworks.com.

    I must confess there where several I’d never heard about…


    📂This entry was posted in PHP 📎and tagged framework PHP

Posts navigation

Previous 1 2


©2019 raindrops Entries RSS and Comments RSS Raindrops Theme