Back to top

Finding color tags and their element - the hard way

Al wants to know - how can I get the color tags and the elements they apply to from a css file. I like the lazyweb so here's my idea, al:


greg@gvs1 ~
$ cat file.css
.tabbrowser-strip {
padding-bottom: 0px;
background-color: #C8C8C8;
background-image: url("chrome://browser/skin/pb-1px-hor-gray-line.gif");
background-repeat: repeat-x;
background-position: top left;
border-bottom: 4px solid;
-moz-border-bottom-colors: #535353 #A1A1A1 #BDBDBD #D9D9D9;
}

greg@gvs1 ~
$ touch empty.css

greg@gvs1 ~
$ grep -v color file.css > empty.css

greg@gvs1 ~
$ diff -up empty.css file.css | grep [{}+] | grep -v +++ | grep -v @@ | sed 's/+ / /'
.tabbrowser-strip {
+ background-color: #C8C8C8;
+ -moz-border-bottom-colors: #535353 #A1A1A1 #BDBDBD #D9D9D9;
}

Step one is your example. Step two creates an empty file. Step 3 takes everything BUT the color lines and outputs them into the empty. Step 4 does a diff in universal format with -p to "Show which C function each change is in.". Well, it's not a C-function but close enough. Then I did three extra greps and a sed on the end one to remove all of the lines BUT the function and "added" lines, two to get rid of the header lines, and the sed will take the plusses that were added by the diff and replace them with nothing.

Drawbacks and Weaknesses:

If you have plusses followed by two spaces in your css then they'll get silently removed. If you have a element named color like a <div class="colored"> then that would suck (but you can easily find those before hand...).

Making it run through directories and do this is a fun exercise with find ./ -exec (stuff) {} \;

Biggest drawback

People Involved: 

More Pretty Impress Templates

I've written about Pretty Impress Templates before, but I found some more good ones recently.

Chih-Hao Tsa has created several templates that are licensed under a Creative Commons Attribution Share Alike license (cc-by-sa).

Favorite Impress Template

Kaohsiung was my favorite:

And...here's the link to this collection of Impress Templates

Category: 
People Involved: 
timeline: 

sb-ssl.google.com security domain name mismatch

If you're one of the folks who is testing out (or using the now released) new Firefox then you've probably seen an error message saying something like "Security Error: Domain Name Mismatch" and then it says a bunch of jargony stuff and then you see that the domain is for "sb-ssl.google.com error 12263... however the security certificate presented belongs to www.google.com...If you suspect the certificate shown does not belong to sb-ssl.google.com please cancel the connection and notify the site administrator". What the heck is that?

People Involved: 
timeline: 

GAIM Encryptiong using Off The Record (OTR) on Windows

As of now, you just install Gaim from http://gaim.sourceforge.net/downloads.php

Then, install OTR from http://www.cypherpunks.ca/otr/.

Then, if you're using the Gaim beta, you need to install the files form this zip: http://lists.cypherpunks.ca/pipermail/otr-users/2006-January/000531.html

Category: 
People Involved: 

Pages

Subscribe to Knaddison.com RSS