Do the CSS mambo!
And be happy you are alive.

Did you know that:

All polar bears are left-handed?

Search the Feed

Codeboxer search results for CSS
Alexa CSS Dreamhost Javascript Joyent Lighthouse Migration MySQL Oracle PHP Pivot SQL ssh status codes svn Unit Test

use rails revision as directory for amazon S3 asset upload

18 May 2010 | 2:51 pm by codeboxer

copied from this excellent video - http://www.bestechvideos.com/2009/06/26/sd-ruby-episode-63-earning-an-a-...

Use this script to upload all your assets to S3 using REVISION to auto expire assets on a new deploy.


#!/usr/bin/env ruby
require file.dirname(__FILE__) + /../config/environment'

require 'aws/s3'
require 'progressbar'

#set up S3 config connect
config = YAML.load(File.open(File.join(RAILS_ROOT, 'config/amazon_s3.yml')))[RAILS_ENV]
bucket = config['bucket_name']
AWS::S3::Base.establish_connection!(
  :access_key_id         => config['access_key_id'],
  :secret_access_key_id  => config['secret_access_key_id']
)

files = Dir.glob(File.join(RAILS_ROOT, 'public/**/*/**/*.{css,js,gif,jpg,png}'))

#set up progress bar
progressbar = ProgressBar.new('Uploading...', files.size)

files.each do |file|
  unless File.directory?(file)
  
  #create an object key from the file name and revision
  key = file.gsub(/.*public\//, "#{REVISION}/")
  
  
  #upload to S3
  #TODO set the right headers for gzipped objects
  AWS::S3::S3Object.store(
    key, open(file), bucket,
    :access => :public_read, :expires => 1.year.from_now
  )
  
  #increment progressbar
  progressbar.inc
  
end

this site rocks

30 March 2009 | 3:40 am by codeboxer

http://layouts.ironmyers.com/

Awesome free css layouts? Ok!

Original post blogged on codeboxer.com.

Be a CSS Sherlock Holmes

3 December 2008 | 6:00 pm by codeboxer

Sometimes you want to do the right thing. Sometimes you want to do the right thing, AND it's possible. This is one of those times. I'm about as guilty as anyone for putting inline CSS all over the place, but I have rebuilt my blog and I am not going to make the same mistakes I did last time.
Question: how do you match a piece of 'source code' to the actual master style sheet reference?
Last year, I might have just overridden the inline div with a "style='display: xxx; color=NEWCOLOR;'" kind of thing, and shoved a bunch of css into the div wherever it happened to be. Today, not so much. Having just set up my new skin the way I like it, using a very few tweaks to the existing style sheet, I needed to track down a way of changing the color of the CODEBOXER.COM in the top left of my screen. You may appreciate that it is now a soothing and complimentary shade of charcoal. It used to be a very whorish red. What did I do?I became a CSS Sherlock Holmes, and you can too!

STEP ONE: VIEW SOURCE
As you must know by now, anyone can view anyone's HTML just by right clicking on their web page. Of course, this isn't the whole show, because this 'source code' is fully 'executed', which is something we don't really need to worry about for this discussion. The reason we are doing it in this case is to see how certain parts of the website are referencing their CSS-ness, post-execution. Behold:

STEP TWO: SECURE THE EVIDENCE

STEP THREE: SEARCH FOR YOUR KEYWORD

and this is what you find:

Basically, the evo_title_area div begat the title_container div which begat the widget_core_coll_title div which within itself held an "a" tag which was enclosed in an "h2" tag.

Do we have enough evidence?

Wait for it...

div.evo_title_area div.widget_core_coll_title h2 a {
color: #4b473b;
}
div.evo_title_area div.widget_core_coll_title h2 a:hover {
color: #aaa;
text-decoration:none;
}

Extra points for the hover.Original post blogged on codeboxer.com.

My Site Links

Screenshots are featured above. If you visit gmgpulse, you may login as demo/demo.

Rockstar Television


© 2008-10 Krister Axel and codeboxer.com