Posts

Showing posts from September, 2013

Best Practices for using Bootstrap

I attended the "Making Peace With Twitter Bootstrap" presentation in html5dev con in early 2013. Although not using Bootstrap at the time, I knew this would be useful at some stage. That "stage" has come. Three key takeaways: 1. manage bloat by taking only what you need e.g.  customizing your bootstrap download for your needs (avoiding bloat). 2. use your class names (see more below) 3. start the design with PSDs that are friendly to bootstrap. Regarding #2, t his is a great post referenced in the presentation which explains how to reduce your dependency on bootstrap : - use the power of less to create your own classes combining bootstraps classes - use bootstrap mixins to style grid rows and columns to avoid including "span", "row" and "offset" in your html (this is cool) This comment is a good guide: " In some cases this may be unnecessary; perhaps Twitter has already chosen the same name for a class that you

Prompt for command line including git branch

in my .bashrc in ~ Put the following:   #⚡ cat .bashrc export EDITOR=/usr/bin/vim if [ -f /opt/local/etc/bash_completion ]; then         . /opt/local/etc/bash_completion fi set -o vi alias ll='ls -l' showBranch(){     if [$(pwd | grep "projects|www") != ""]; then         git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/±\1/' | tr "\n" ' '         hg branch 2> /dev/null | sed -e 's/\(.*\)/☿\1 /'     fi } export PS1='\e[01;32m\u\e[34m@\H \e[01;31m\w \e[32;40m$(showBranch) \n\[\e[30m\]#\[\e[33m\]⚡ \[\e[0m\]' Notes - type "bash" on command line to see latest changes take effect - in the if stmt in showBranch() you should put the folder in which you put your repos, e.g. for me my code is always under a folder named work, so the if is: if [$(pwd | grep "work|www") != ""]; then - more reading here  useful article - thanks to my budd

Angular.js hosted on Amazon S3

Here's a simple angular.js app I wrote following the basic tutorial which is hosted on Amazon S3. My first  angular.js app is a very simple one to list names and search them. Following the tutorial by Dan Wahlin, I defined an angular app and simple controller as part of the mvc I configured Amazon S3 to host the page. The angular.js library is pulled from google hosting. Next I plan to follow more complex tutorials and build and deploy those to S3.