#web development


Bash Completion, Along with SVN and Git Tab Completion

Time is pre­cious. I installed these util­i­ties to save some of it:

I install bash-com­ple­tion via Mac­Ports on my Macs.

sudo port install bash-completion

I then saved this svn-com­ple­tion script to local­ly, and did a sudo cp:

sudo cp bash_completion /opt/local/etc/bash_completion.d/svn-completion.sh

Note: “bash_completion” is the file linked on “svn-com­ple­tion script”. I hope that avoids con­fu­sion.

Last but not least, I then installed the git-com­ple­tion script. I first checked the ver­sion of Git I have via Mac­Ports which hap­pens to be 1.6.0.5.1 I then saved and untarred the Git tar­ball of the ver­sion I have local­ly. Then did anoth­er sudo cp of the actu­al git-com­ple­tion script to the same direc­to­ry where my svn-completion.sh is locat­ed at:

sudo cp git-1.6.0.5/contrib/completion/git-completion.bash /opt/local/etc/bash_completion.d/git-completion.sh

After that, I added the fol­low­ing to to my .pro­file (or .bash_profile):

# for bash-completion
if [ -f /opt/local/etc/bash_completion ]; then
    . /opt/local/etc/bash_completion
fi
source /opt/local/etc/bash_completion.d/svn-completion.sh
source /opt/local/etc/bash_completion.d/git-completion.sh

Either restart your Ter­mi­nal, or re-exe­cute your .pro­file, and that would do it.

For more info on Git com­ple­tion, check out this arti­cle by Kamal Fariz (bit­flu­ent).

  1. Got it by using git ver­sion. []

Git Info — Almost Like “svn info”

I have been try­ing to find some­thing like svn info but for Git. Luck­i­ly, I stum­bled upon Duane John­son’s script. Here’s git-info.sh:

I made an alias in my .pro­file to make it a bit more acces­si­ble:

Clearfix Revisited

The new style rules I’m using:

.clear:after {
    content:" ";
    display:block;
    height:0;
    clear:both;
    visibility:hidden;
    font-size:0;
}
.clear { display: inline-block; }
/* Hides from IE-mac \*/
* html .clear { height:1%; }
.clear { display:block; }
/* End hide from IE-mac */

For more infor­ma­tion on the update, have a read over at Jeff Star­r’s Per­ish­able Press arti­cle. If you are com­plete­ly new to this tech­nique, it orig­i­nat­ed from this arti­cle.

IE Web Developer Toolbar

Just stum­bled on a link of a link and found that there is too a “web devel­op­er tool­bar” for IE. Although (cur­rent­ly) unrat­ed, it seems to pro­vide some use­ful func­tion­al­i­ty:

  • Explore and mod­i­fy the doc­u­ment object mod­el (DOM) of a web page.
  • Locate and select spe­cif­ic ele­ments on a web page through a vari­ety of tech­niques.
  • Selec­tive­ly dis­able Inter­net Explor­er set­tings.
  • View HTML object class names, ID’s, and details such as link paths, tab index val­ues, and access keys.
  • Out­line tables, table cells, images, or select­ed tags.
  • Val­i­date HTML, CSS, WAI, and RSS web feed links.
  • Dis­play image dimen­sions, file sizes, path infor­ma­tion, and alter­nate (ALT) text.
  • Imme­di­ate­ly resize the brows­er win­dow to 800x600 or a cus­tom size.
  • Selec­tive­ly clear the brows­er cache and saved cook­ies. Choose from all objects or those asso­ci­at­ed with a giv­en domain.
  • Choose direct links to W3C spec­i­fi­ca­tion ref­er­ences, the Inter­net Explor­er team weblog (blog), and oth­er resources.
  • Dis­play a ful­ly fea­tured design ruler to help accu­rate­ly align objects on your pages.

But, don’t go and down­load­ing all at once… after all it is still in beta—“Beta 2” to be exact.