0

Giving Users Style Choice

Posted by stuporglue on Mar 14, 2010 in Programming, Projects

Sometimes your site’s style doesn’t meet the needs of all your visitors. With some simple PHP and javascript you can provide a different CSS file for users with small screens.

Tags: , ,

 
0

CSS color extracter

Posted by stuporglue on Mar 14, 2010 in Programming, Projects

This is one of the reasons I love Ruby. I wrote some code that would take a CSS file and print out the unique hex colors, and it was about 10 lines long. I then realized that if I had been thinking in Ruby, I could do it in just one line. This page is OLD and probably contains errors, out of date information, security flaws or other problems. I am keeping it around because it might be helpful to someone. File.readlines(ARGV[0]).to_s.downcase.scan(/#[0-9a-f]{6}/).uniq.sort.each {|one| puts one} if (ARGV[0] != nil) Put that in a Ruby file, and run it with a…Read the Rest

Tags: , , , ,

Original content on this page is under the Creative Commons Attribution-ShareAlike 3.0 License unless otherwise noted.

If you found this page particularly helpful, I'd love to hear from you. A link to this page from your blog or website would also be appreciated.

I'm the real Michael Moore