Easter Eggs with a twist

My daughters gave dying eggs with some of my old silk neckties a try. The warmer colors like red came out really nice, even captured the patterns on the tie. Blues didn’t do as well.  


The process is super simple, just wrap up the egg in the tie, tie it with string and boil. 

Here is a Blog post with more details on the process => http://www.mommyknows.com/silk-tie-dye-easter-eggs-tutorial/




Seeing the world through rose colored Goggles



I am close to tech, very close, and sometimes in my field we do things for the enjoyment of technology. Sometimes we do things to see if it can be done, how cool it is when it is done, and what we had to do in order to get it done. However, sometimes we also loose sight of the real world use cases of a particular technology. I recently had that happen to me and thought I would share the story of how Google Goggles brought peace into our house. (Ok, that might be a little dramatization but you get the point.) 

My wife loves to scrapbook. She’s been doing it for years and she is pretty good at it. She enjoys it so much she will scrapbook other peoples pictures. I use to tell her she should think about doing web layout designs because it was very similar and we could us it as “together time”. Her reply was “maybe you should learn scrapbooking”… I didn’t approach that topic again, point was taken. When she scrapbooks for other people she gets pictures in all sorts of different states. Some are very organized with detailed information or what, when, and where a picture was taken, sometimes its just a box off random photos. 

My wife has learned that when I am coding not to worry or concern herself with the signs of frustration I may display and sometimes the colorful language I may use when in such a state of mind. As I have learned the similar lesson when she scrapbooks so when she was showing some of those signs of frustration with her latest project it wasn’t unusual. She had received a bunch of photos of a families vacation that spanned a bunch of locations around the world. She was told the family had gone to China and then Italy but that this was over 5 years ago and no one was sure of exactly which landmarks they had photographed. 

The wife had spent days trying to decode what were in the photos and where they were taken. In one of her moments of frustration she says “I need to be able to feed these pictures into a computer and have the computer tell me what they are. Can you please write something like that.” My reply went something like, “Sure honey I will get right on that …. Hey wait a minute, I think that already exist” I pulled out my HTC Evo running Android and asked her to give me a picture. I had seen that look she flashed me before, the look that borders on “you are full of BS” and “don’t waste my time”. I tell her, “No I am serious, give me a photo of something you can’t identify” She hands me a photo of some old ruins with pillars. Nothing really special about the photo and nothing really stood out to me. I fired up Google Goggles on my Evo and scanned the picture and almost instantly it returned the results “Pompei Basilica, Pompei, Italy”. We just looked at each other and said “COOL!”, but was it right? We clicked on the link that Goggles presented to us in the results and sure enough there was another, almost exact same photo, on a site talking about the ruins. 

The wifes face lite up. “Let’s do another”. We did a couple more and thing were looking good until we ran into a little snag, “The Parthenon”. The problem was the Parthenon was in Greece, not Italy. “No one mentioned a visit to Greece” the wife said. We did some research and it really seem liked Goggles properly identified it. We scanned some more and would run into more landmarks from Greece, then Istanbul, Turkey. Two places never mentioned to the wife that were part of the trip. Needless to say this dramatically impacted the scrapbook layout she was working on but she was ecstatic about the new tool she found. She managed to scan her entire book in less that an hour, catch, and make several geographical corrections. 

Wife walked away with a new appreciation of technology and I got to feel like a little bit of a Super Hero for a few hours. Just thought it was a cool series of events and thought I would share it.  

Gina Trapani (@ginatrapani) and Me (@shocm)

I got the pleasure to meet a person in my industry who I have the utmost admiration and respect for. Gina Trapani is a Open Source developer, author, host on TWIG, founder of Lifehacker, and a prolific blogger. It was a real honor.

Geometry – The Batman equation.

Came across this on Stack Exchange. Just fun geek stuff.


I'm really starting to see a pattern to my internet browsing habits.


This is such a typical browser tab configuration on my browser. I really do find myself using more and more of Googles services more and more often. 


I like how Google identifies it's export feature "Data liberation"


One of the reason I enjoy using Googles Services, they typical seem to go above and beyond to make sure you always own your data. 

Geek Stuff, General, linux

Getting some functionality back in the system tray on Ubuntu 11.04

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
[bash]gsettings set com.canonical.Unity.Panel systray-whitelist "[‘all’]"[/bash]
As you can see I got all my system tray icons back and I am now a little happier with Unity.




Tagged , ,
F/OSS, General

Why the Open Source Development Model Works

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.

Posted via email from shocm

Geek Stuff

Reposting a great article I can across for all my PHP buddies out there who want to use Vi for development

The original posting can be found here



Howto Setup Vim IDE for PHP Development

Howto Setup Vim IDE for PHP Development
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
syntax on

" 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
set viminfo=’10,"100,:5000,%,n~/.viminfo

" omnicomplete from: http://vim.wikia.com/wiki/VimTip1386
set completeopt=longest,menuone
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 🙂
set complete+=kspell

" disable tabs
set expandtab
set shiftwidth=4
set softtabstop=4

" highlt matches
set hlsearch

" 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
set ofu=syntaxcomplete#Complete

" You might also find this useful
" PHP Generated Code Highlights (HTML & SQL)
let php_sql_query=1
let php_htmlInStrings=1
let g:php_folding=2
set foldmethod=syntax

" ——————–
" Project
" ——————–
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
augroup JumpCursorOnEdit
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 |
endif |
exe JumpCursorOnEdit_foo |
endif |
" 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 |
endif |
unlet b:doopenfold |
augroup END

" PHP code sniffer
" If code sniffer is installed you can run it on current php file by running
" :Phpcs
function! RunPhpcs()
let l:filename=@%
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")
unlet l:phpcs_list[0]
cexpr l:phpcs_list

set errorformat+="%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"
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.

I will soon write another howto to explain how can you use further features of your IDE. You should subscribe to the feed or follow me on twitter to stay updated. :)

%d bloggers like this: