Saari Development

Ali Rizvi's Technical Blog as a Professional Software Development Engineer

Using Adobe’s New Source Code Fonts in Sublime Text 2 on Mac

with one comment

I just tweeted how much I love using the newly discovered Adobe Code fonts in Sublime Text 2 and though I should document the steps I followed to use them:

  1. Download font from Adobe Sourceforge: Source Sans Pro & Source Code Pro
  2. The easiest way I found to install all the font files on a Mac was to go to the terminal; cd to the downloaded font directory and type:

    open *.otf

  3. All the files will open in the Font Book app; Click “Install” button for each of them
  4. Now to use it open Sublime Text 2; open Preference -> Settings – User
  5. Add the following lines to the existing settings (if empty add these lines inside braces {}) to use the Light version of Source Sans Pro font in Size 17

    "font_size": 17.0,
    "font_face": "Source Code Pro Light"
    //"font_face": "Source Sans Pro Light"

  6. You can toggle the “//” on the two lines to try out the other font and adjust the font size as you prefer

Happy Coding!!!

Written by imsaar

September 28, 2012 at 9:21 am

Posted in code, editor, macosx

Mac OSX : Reading Application Preference on Command Line

leave a comment »

I forget this often and find it useful at times to see the contents of my preference file. One mistake I often make is not to remove the file extension (.plist).

defaults read /Library/Preferences/com.apple.loginwindow

I am not a big fan of forums but this detailed entry helped me:
How to view plist files?

The main reason I was doing this was to keep preferences on my two laptops in sync and wanted to make sure to see if this is the right directory to SugarSync.

Written by imsaar

January 30, 2012 at 12:22 pm

Posted in configuration, macosx, shell

Converting space separated output to one per line

leave a comment »

Here is the problem I was faced with. I wanted to check if I was part of a particular group and I did the shell groups command to find out.

Unbeknownst to me I was part of a tone of groups that included some complicated long names with backslashes (\) in them.

I thought it would be quick to grep for the particular group name if all the output was on separate lines instead of space separated on one line.

First I thought I can use cut command to do that but it turns out cut is not idea for this. It is more suitable if you have multiple lines of data and wanted to get the same column out of each of these. Something like output from ps.

Finally I achieved it really easily with with tr command. Here is how the solution looks like:


groups | tr ' ' '\n' | grep group_i_was_looking_for

Written by imsaar

January 13, 2012 at 1:04 pm

Posted in general

Windows: Printing Date and Time on Command Line

with one comment

I am more of a *nix (unix, linux etc) command line person but I still use windows from time to time (in this case because my macbook pro crashed).

I often want to see the progress of output to a file over time using the following linux command line:

$ date; wc -l output.txt

On windows date does not print time (you have to do ‘date \t’ to get output from it otherwise it used for changing the system date).

I finally found what I was looking for:

> echo %DATE% & echo %TIME% & wc -l output.txt

Output:

Thu 07/21/2011
13:44:55.70
375 output.txt

 

The wc command and bunch of other unix commands come from the free UnixUtils opensource package for windows. I consider UnixUtils a must have for windows and among the first thing I install on my windows machine.

Written by imsaar

July 21, 2011 at 12:44 pm

Posted in windows

Collaboration and Software Development (Part 1 of 2)

with one comment

I believe quality software development is a collaborative process and I personally consider myself a collaborative person (there could be some cognitive bias here)  I am happy to be working in an organization in which being Collaborative is a recognized as a core value.

The above assertion raises some questions:

What is collaboration?

Collaboration is the act of working together, caring about the common product and each other. Collaboration is often confused with cooperation which is different. I found the distinction cited here very well done:

Dillenbourg et al. (1995) make a distinction between cooperation and collaboration.

They define cooperative work as “... accomplished by the division of labor
among participants, as an activity where each person is responsible for a
portion of the problem solving...” They define collaboration as “…mutual
engagement of participants in a coordinated effort to solve the problem
together. They further note that work often is split also in
collaboration. But the difference is that in cooperation the task is split
(hierarchically) into independent subtasks, and in collaboration the
cognitive processes may be (heterarchically) divided into intertwined
layers.

Another concept that is similar and confusable is contribution. Which is doing your part towards the goal but not necessarily as part of a team or together.

What is the opposite of collaboration?

Sometimes helps to identify and understand the opposite of a concept to appreciate the concept itself. So what is the opposite of collaboration. Some would say Coercion but I think it is Competition.

I have seen it many times in my 10+ years of software development experience where individuals would get in a competitive mode due to internal reason like personality types or external reason like management’s scarcity mentality where people are stack ranked on basis of individual contributions.

How does competition looks like in a Software team?

  • My code is better than yours.  There should be a joint ownership of all of the code in team.
  • I don’t have time for your problem. If this is a team they should be working towards a common goal hence any problem is our problem.
  • Common use of hand waving help where you don’t really get engaged in the problem solving just try to give an idea to try to get back to “your” project/piece.
  • Rubber stamp code reviews
  • No passionate disagreement or challenging of individual assumption. This is passive competition or lack of care.
  • Criticism without owning the problem or offering a solution.

Read the rest of this entry »

Written by imsaar

December 28, 2010 at 6:40 pm

Vim: Set vim filetype to ruby in a Treetop grammar file

leave a comment »

While writing a syntax parser using ruby treetop library for a work project I discovered the need to use ruby filetype for syntax highlighting etc a file ending in .treetop (treetop uses polyglot to look for and compile the grammar on runtime but the grammar file has to end in .treetop).

Here is a nice getting started tutorial for treetop: http://po-ru.com/diary/getting-started-with-treetop/

I could have used some configuration in my .vimrc file to associate this file extension with ruby filetype but I want to try the embedded configuration which I have seen other used but never used myself.

After some search I found the reference article below and was by just adding the following file in the .treetop file I was able to desired functionality:

# vim:filetype=ruby

Ref:Embedding vim Settings in the File You’re Editing

Written by imsaar

June 7, 2010 at 4:21 pm

Posted in editor, vim

Config: .gitconfig

leave a comment »

[color]
        ui = auto
[alias]
  co = checkout
  br = branch
  st = status
  lol = log --format=\"%h (%aE %ar) -> %s\" --graph --decorate

Thanks to Arnab Deka

Written by imsaar

March 31, 2010 at 2:47 pm

Posted in configuration, git