Ubuntu 11.04 introduced a new, cleaner user interface called Unity. I'm not a huge desktop GUI guy, doing a large majority of my work in the command line, but I do like to try and stay current on the latest greatest interfaces.
I'm not overwhelmed with Unity. It's OK but not really earth shattering. You have the option to switch back to the "classic" Gnome interface if you wanted to but I haven't done that.
One huge annoyance I've noticed about the new Unity interface was a lack of a true "system tray". Many application in Ubuntu (or Linux in general) leverage a similar approach Windows machine do and allow applications to run in a System Tray, cleaning up any task bars you might have. In Unity, there were a couple applications that were visible, like Dropbox, the clock and Volume but several others were not such as Skype and Truecrypt.
This became a big problem for Truecrypt because once I closed the Truecrypt interface I couldn't figure out how to get back to it. If I tried to launch the application again the system would report that it the application was already running, which it was. In the past I would get back to the interface through the icon in the system tray but this icon would not display in Unity, at least not until I found a posting on Facebook http://www.facebook.com/topic.php?uid=6723083591&topic=17003
This simple command in a terminal window corrected my problem and life is good again
- gsettings set com.canonical.Unity.Panel systray-whitelist "['all']"
As you can see I got all my system tray icons back and I am now a little happier with Unity.
I’ve stumbled across this video several time, most recently on a blog post of an extremely talented developer and someone I’ve had the pleasure of working with.
If you’re not a developer it can be kind of hard to wrap your head around what is being outline but if you stop thinking of what is being talked about as work and more as a something you enjoy doing it makes more sense. They make a great reference comparing work to music in the video but it could be anything, painting, gardening, working on your car. The thing a lot of non-developers (managers, bosses, what have you) don’t get is that some of us in the IT field do this because its what we enjoy doing. I wasn't always in IT, at one time I was in a completely unrelated industry and even during that period, my free time was doing some sort of development or general computer hacking. Not because it was going to move me up in the company I was working at but because it was what I wanted to do in my free time and has been that way since my Dad got me a TRS-80 for Christmas ’85.
This is why Open Source Development works. Not because there is a big carrot hanging at the end of the stick, but because there is a passion and thirst for knowledge. The reward structure in Open Source is always difficult to explain to people but this video does a great job at capturing some of the attributes that does drive Open Source Development.
The original posting can be found here
As a PHP developer one has quiet a lot of choices of IDE. Some are graphical will built-in features like debugging, code completion, auto indentation, syntax highlighting, code checking and many more. But those IDEs are very heavy and slow to use, and I know many people like me who just can’t live without Vim and want to use Vim for all type of text editing they do, whether they are writing code, editing configuration files or may be creating simple text files.
Recently I posted a screenshot of my Vim editor and got a lot of emails that how did I setup Vim that way. So, I hope this howto will be easy enough for everyone to follow and setup their Vim as their PHP IDE. For the sake of simplicity I am assuming you are using Vim on Linux or Linux like system. If you are a windows user then this guide should still work for you, but I might not be able to provide Windows related details where needed.
Features that we will add or enable in Vim to make it a complete IDE.
- Code Completion
- Tag Lists
- Project Management
- Syntax Highlighting
- Code Checking
First we need to download following Vim scripts and extract them in our ~/.vim directory.
Download above scripts one by one and install them. Installing them is easy just unzip them in you .vim directory which is located in your home directory. Now we need to download few files in our .vim/plugin directory. Download the following Vim scripts directly into your .vim/plugin directory.
Now that you have installed above scripts, you are almost all set to go. You just need to paste the following content in your .vimrc file which is located in your home directory.
" ~/.vimrc "
" Version: 0.1 "
" Hightlight the ifs and buts
" Plugins and indentation based on the file type
filetype plugin indent on
" Don't remember source of this, i think it was already in my .vimrc
" Tell vim to remember certain things when we exit
" '10 : marks will be remembered for up to 10 previously edited files
" "100 : will save up to 100 lines for each register
" :5000 : up to 5000 lines of command-line history will be remembered
" % : saves and restores the buffer list
" n... : where to save the viminfo files
" omnicomplete from: http://vim.wikia.com/wiki/VimTip1386
inoremap <expr> <CR> pumvisible() ? "<C-y>" : "<C-g>u<CR>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
'<C-n><C-r>=pumvisible() ? "<lt>Down>" : ""<CR>'
"## PHP ##
" The php doc plugin
" source ~/.vim/php-doc.vim
inoremap <C-P> <ESC>:call PhpDocSingle()<CR>i
nnoremap <C-P> :call PhpDocSingle()<CR>
vnoremap <C-P> :call PhpDocRange()<CR>
" run file with PHP CLI (CTRL-M)
:autocmd FileType php noremap <C-M> :w!<CR>:!/usr/bin/php %<CR>
" PHP parser check (CTRL-L)
:autocmd FileType php noremap <C-L> :!/usr/bin/php -l %<CR>
" Do use the currently active spell checking for completion though!
" (I love this feature 🙂
" disable tabs
" highlt matches
" Taken from http://peterodding.com/code/vim/profile/vimrc
" Make Vim open and close folded text as needed because I can't be bothered to
" do so myself and wouldn't use text folding at all if it wasn't automatic.
set foldmethod=marker foldopen=all,insert foldclose=all
" Enable enhanced command line completion.
set wildmenu wildmode=list:full
" Ignore these filenames during enhanced command line completion.
set wildignore+=*.aux,*.out,*.toc " LaTeX intermediate files
set wildignore+=*.jpg,*.bmp,*.gif " binary images
set wildignore+=*.luac " Lua byte code
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
set wildignore+=*.pyc " Python byte code
set wildignore+=*.spl " compiled spelling word lists
set wildignore+=*.sw? " Vim swap files
" Enable completion dictionaries for PHP buffers.
autocmd FileType php set complete+=k~/.vim/dict/PHP.dict
" PHP Autocomplete
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
" You might also find this useful
" PHP Generated Code Highlights (HTML & SQL)
map <A-S-p> :Project<CR>
map <A-S-o> :Project<CR>:redraw<CR>/
nmap <silent> <F3> <Plug>ToggleProject
"let g:proj_window_width = 30
"let g:proj_window_increment = 150
nnoremap <silent> <F8> :TlistToggle<CR>
let Tlist_Exit_OnlyWindow = 1 " exit if taglist is last window open
let Tlist_Show_One_File = 1 " Only show tags for current buffer
let Tlist_Enable_Fold_Column = 0 " no fold column (only showing one file)
let tlist_sql_settings = 'sql;P:package;t:table'
let tlist_ant_settings = 'ant;p:Project;r:Property;t:Target'
" auto change directory from: http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
autocmd BufEnter * if expand("%:p:h") !~ '^/tmp' | lcd %:p:h | endif
" when we reload, tell vim to restore the cursor to the saved position
autocmd BufReadPost *
if expand("<afile>:p:h") !=? $TEMP |
if line("'"") > 1 && line("'"") <= line("$") |
let JumpCursorOnEdit_foo = line("'"") |
let b:doopenfold = 1 |
if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
let b:doopenfold = 2 |
exe JumpCursorOnEdit_foo |
" Need to postpone using "zv" until after reading the modelines.
autocmd BufWinEnter *
if exists("b:doopenfold") |
exe "normal zv" |
if(b:doopenfold > 1) |
exe "+".1 |
unlet b:doopenfold |
" PHP code sniffer
" If code sniffer is installed you can run it on current php file by running
let l:[email protected]%
let l:phpcs_output=system('phpcs --report=csv --standard=YMC '.l:filename)
" echo l:phpcs_output
let l:phpcs_list=split(l:phpcs_output, "n")
command! Phpcs execute RunPhpcs()
Thats it, now you are all set to go. Following are the few quick commands to get you started to use all the features you have just enabled in your Vim IDE.
F3: To start using project manager.
C: After starting project manager this key combination will allow you to add new project.
F8: Tag list window
Ctrl+L: To run the syntax checking on your php file
Ctrl+P: On any class/function definition to add php doc strings
“:PhpCs”: To run PHP Code sniffer on your php script. (this requires code sniffer to be installed).
Ctrl+n: On any word to use Auto completion feature of PHP.
Being an "Open Source" guy there is a certain stigma that goes along with that title, one being that everything you use has to be Open Source. Where I take great pride in the knowledge there isn't really any aspect of my digital life I couldn't do without an Open Source solution, I personally don't necessarily make Open Source a "requirement". I always look for the best solution and tool for a particular task, for me freedom and access to the code weighs heavily in that decision but is not the only parameters in picking a solution.
In the interest of full discloser, and because there are people who enjoy pointing out when they "catch me" not using Open Source (as if I don't know), I present to you a list of my Non-Open Source guilty pleasures that I use frequently (with some justification for using them)
Note: with the exceptions of OSX and the Microsoft products all solutions below do offer free versions of their products though I typically pay for the upgraded products.
- Evernote (http://www.evernote.com) - There are several alternatives to Evernote, including Open Sources ones such as Tomboy but they all seem to lack either features or cross platform compatibility. Evernote does have a OSX and Windows client but no client for Linux which has always been a huge draw back. Evernote does have a pretty good web interface, which continues to improve and this helps a lot when I am on my Linux desktops. Evernote also have a lot of open APIs and there has been some activity to writing alternative Evernote clients that will run on Linux desktops including one I've checked out called Nevernote (http://nevernote.sourceforge.net/)
- Navicat (http://www.navicat.com/) - I simple like this tool. The user interface and feature set is wonderful. There are tons of Open Source GUI clients to connect to MySQL database and even though 99% on my database activity is connecting to a MySQL backend every now and then I need to connect to MSSQL, Oracle, or PostgreSQL and my Navicat Premium allows me to do this in one client. It also has a wonderful feature of establishing my MySQL connections over SSH which I love when I need to work on my Windows boxes. It's baked in so I don't have to establish my own separate SSH tunnel. They also have clients for Windows, OSX, and Linux
- Dropbox (http://db.tt/AyOLUYV) – I have to be honest, I’ve used Dropbox for several years but it is always on my hit list to move to an alternative Open Source solution. There seems to be a new one that drops every month. When I get comfortable with the staying power and feature set that Dropbox offer, I will probably drop Dropbox.
- OSX (http://www.apple.com/macosx/) - This is really a decision of convince than anything else. There are typically a greater number “vendor support” desktop application that are not support on Linux desktops such as the previously mentioned Evernote. However OSX is BSD at heart and lets me retain a lot of the Open Source tools I am accustomed to on my Linux desktop including a very power command line and scripting ability. My OSX desktop also affords me the unique benefit of running virtualization software such as Virtualbox (http://www.virtualbox.org/) and allow me to run Windows, several Linux distributions, and OSX all on one physical machine. This is really nice especially when needing to do testing.
All developers have had to, and one time or another, write a validation class. Over the years, I've personally tweaked my own validation class and it has become a pretty standard part of all my coding project; However that may all change now.
Respect is not the first PHP validation class to hit the tubes of the Net but it does appear to be one of the better implemented and flexible ones out there.
More powerful Validation from Respect - http://pulsene.ws/1atzk
After years of being an advocate for the for the Open Source approach and philosophy behind OpenOffice, which for years lead the way as a alternative solution to more proprietary office suites, I've forced to reevaluate my recommendation of the OpenOffice suite. After Sun was acquired by Oracle, Oracle's direction for the OpenOffice suite seemed shaky and not really inline with the community. This is where the power of Open Source shines, the OpenOffice was forked and a new project was started by the name of LibreOffice (http://www.libreoffice.org/ / http://www.documentfoundation.org/download/)
There is a good step by step on how to remove OpenOffice and install LibreOffice on your Ubuntu box on the txwikinger Blog http://goo.gl/PF9T6
This is a really good talk about APIs and their place as a real business model. It's a little long but has a lot of great point and examples for both the very geeky and the very business minded individuals.
I've often had discussion around the open API approach vs Open Source approach and if open API's might not be a good substitution for a business who, for whatever reason, don't want to go Open Source with their model.
Sam Ramji does a great job of outlining exactly how you should think of yourself in an API world as a business. He touches on how to iterate the growth of an API model and listen to the users of it.
Great talk in general, if this type of stuff interest you please give it a watch. It's about 45 minutes long. He also made the slides and content available through Creative Commons.
Saw this on Reddit and had to track down where I can buy some. Looks like I might be making a Amazon order. Perfect as a stocking stuffer http://www.amazon.com/Rocks-Whiskey-Stones-Set/dp/B002GZX2DE
Nice article posted on the Sony Electronics Blog ( http://blog.discover.sonystyle.com/interview-with-comic-book-legend-jim-lee ) that has an interview with Jim Lee from DC Universe Online which is going to be a cool game that lets you be a hero (and maybe even a villain) in the DC Universe. I am a huge Batman fan so there is no question I will be giving this a look. The trailer moves on the sites are pretty intense http://www.dcuniverseonline.com/