Luke,on the topic of  Tools, Web Development
03.26.2010   |   3comment

As Front End Web Devs CSS is our biggest tool. CSS itself keeps getting better and better. We need to keep up on our tool to use it to its fullest. I’d like to talk about a pseudo-selector tool that I have not used much that I would like to embrace in upcoming projects. I find that it will be really valuable to me. I think the Backend Devs will like it to because I won’t have to come bug them as much if I can make proper use of this selector. It is the nth-child selector.

nth-child

Lets say that a client decided they would like the background of every other <li> tag to be darker than the rest. This <li> is created dynamically. In the past I would have to go contact a Back End Dev and have him write some code to put a class on every other <li>. Then I would go style those with the new class. With the use of the nth-child pseudo selector I can do this with the CSS alone. Here’s how:

ul li:nth-child(2n+1) { background:#212121; }

The expression 2n+1 will match the first, third, fifth, seventh, and so on, elements if they exist. 2n+1 isn’t the only expression you can run. Here is a list of a few possibilities:

  • 4n+1 would select the first, fifth, ninth, thirteenth…
  • 4n would select fourth, eighth, twelfth, sixteenth…
  • -n+5 would select fifth, fourth, third, second, first, none

If this isn’t making perfect sense yet just run the math loop in your head and it will. Lets take the first example again. 2n+1

  • 2*0+1=1
  • 2*1+1=3
  • 2*2+1=5
  • 2*3+1=7

Before we go out and use this everywhere I should point out that IE doesn’t support this in any of its versions. The saving point to this though is that jQuery does support all CSS selectors so if you are using jQuery you should be fine. For examples of how the nth-child works with jQuery see this page. Happy Coding.


Luke,on the topic of  Uncategorized
12.22.2009   |   1comment

The code in an older post that talks about GeekTool calls the weather images to your desktop through Yahoo. They recently changed the location of these images so the GeekTool code no longer works. If you take the url at the beginning of your GeekTool script and paste it into a browser it will redirect you to the new url. Take that one and paste it back into GeekTool and it will be working again.

http://weather.yahoo.com/forecast/USUT0078.html

changes to

http://weather.yahoo.com/united-states/utah/farmington-2402466/

Sorry took so long to get this posted.


Luke,on the topic of  CakePHP, Web Development
10.29.2009   |   0comment

We recently launched a small ecommerce site for Whirly Bin. They sell all sorts of stationary. They needed a super simple shopping cart. Instead of hooking in our custom cart in CakePHP we hooked it up to PayPal. Whirly Bin can add new products and upload photos and descriptions for those products through a simple admin section we created with CakePHP. Whilry Bin was great to work with and we got the site designed, built, and up really quick. Check out their site.


Luke,on the topic of  Apple, Fun, Tools
10.13.2009   |   17comment

The code on this post has been updated. View here to get the latest.

In my previous post I talked about what I have been doing to my desktop the last little while. I had quite a few email or IM me asking about how the GeekTool scripts I used. Just take these scripts and copy the lines you want into the command area of a Geeklet. Most of these were written by Mac Newbold. Enjoy!

CPU Usage

top -n1 -l1 | grep "Load Avg" | sed 's/.*usage: //; s/ user.*//;'
top -n1 -l1 | grep "Load Avg" | sed 's/.*user, //; s/ sys.*//;'
top -n1 -l1 | grep "Load Avg" | sed 's/.*sys, //; s/ idle.*//;'

Memory

top -n 1 -l 1 | grep PhysMem | sed 's/.* inactive, //; s/ used.*//;'
top -n 1 -l 1 | grep PhysMem | sed 's/.* used, //; s/ free.*//;'

Month

date +%B

Date

date +%d

Day

date +%A

Time

date +%I:%M

AM / PM

date +%p

Weather

curl --silent "http://xml.weather.yahoo.com/forecastrss?p=USUT0078&u=f" | grep -E '(Current Conditions:|F<BR)' | sed -e 's/Current Conditions://' -e 's/<br \/>//' -e 's/<b>//' -e 's/<\/b>//' -e 's/<BR \/>//' -e 's/<description>//' -e 's/<\/description>//'

Look for the ‘UT0078′ here and replace it with the city code you want to display. Get the city code by going to Yahoo Weather and searching for your city. Once found look in the url and you will see your city code at the end of the url.

Weather Image

Create a new Shell Geeklet and use this as the command:

curl --silent "http://weather.yahoo.com/forecast/USUT0078.html" | grep "forecast-icon" | sed "s/.*background\:url(\'\(.*\)\')\;\ _background.*/\1/" | xargs curl --silent -o /tmp/weather1.png\

Replace the city code with your city code. ( same steps to get city code as above )

Then create a new Image Geeklet and use this as the url:

file:///tmp/weather1.png


Luke,on the topic of  Apple, Fun, Tools
10.13.2009   |   1comment

So for a few weeks now I have been playing around with a themed desktop for my mac. I have always wanted to try something like this out just never had the guts or time. I have found that it isn’t scary at all and rather quick to get going. There are some free tools I have used and some nice things I have learned along the way.desktop1

Not having a dock at all has taken some getting used to. I use Quicksilver for just about everything now. I do have a pull down docklike thing at the top middle in case I ever need it. Here is a list of tools I have used to create my new desktop.

CandyBar – Change all the folders icons and HD icons.
Magnifique – Change the folder and App nav areas to black
GeekTool – Add time, weather, and computer status to the desktop.

GeekTool was by far the most fun. You can do much more with it than what I have done here. If you come up with something good for you I’d love to see it.


Luke,on the topic of  Tools
05.07.2009   |   0comment

crossloopI have needed a screen sharing service multiple times and I have never had a really easy way to do it. I have shared screens with clients that use Macs with iChat but more often than not the person I want to screen share with isn’t on a Mac. CrossLoop is super easy and lets you screen share with any Mac or PC. If you ever need to screen share use CrossLoop.


Luke,on the topic of  Coding Music
04.13.2009   |   2comment

etecoverIt has been a while since our first Music for Coding post. I have been going through a mellow music stage and thought I would put a plug in for El Ten Eleven. My favorite album is Ten Eleven. They have some great guitar! I love the overall mood that they create when I am coding. Listen to El Ten Eleven


Luke,on the topic of  News
03.31.2009   |   0comment

Yea I know, that’s a long chunk of capital letters in the title. It stands for Intermountain West Nursing Staff Development Organization. They are a group of nurses that needed to be able to post news and events on their site. They host educational events for developing a well trained staff of nurses. They had a small site but it was still very fun to code. Let us know what you think.

Screenshot of the IMWNSDO website

Screenshot of the IMWNSDO website


Luke,on the topic of  Browsers
03.18.2009   |   3comment

On the train ride home Friday Kevin Carter and I were talking and complaining about good ol Microsoft. We talked how it would be great if Microsoft just quit making a browser. The next day he sent me this article. I was pretty surprised that what we were talking about on the train might become partly true. Infoworld mentions that it is quite possible that IE8 will be the last IE. That doesn’t mean that Microsoft will quit making a browser. They will just create a new browser not running on the IE engine. That would be awesome to not have the IE engine around anymore. Anyways check out the article for yourself and let us know what you think.


Luke,on the topic of  Coding Music
03.12.2009   |   8comment

Coding always goes much better and smoother with a good environment to code in. I think that a good part of creating that environment is music. Mike and I always think it is fun to crank up the Mortal Combat theme song when working on squashing an IE6 bug. Gets you all charged up to take it down! Anyways, we will start posting an album now and again of music we like to play when coding. If you have any you like please feel free to comment.

ratatatThe first album is a favorite of mine. It is by Ratatat and the album is called Classics. I highly recommend it. If you get it make sure you listen for the wildcat growl.