Skip to main content

Close
Get the best research tool on the web today,and free!
Connect with people with common interests!
Play Webslides

Site Community for

John Resig - JavaScript, Programming, and Web Applications

No description available

Expand All 1 - 20 Next ›
Nicolas Steinmetz

John Resig - Why Tamarin instead of…

I’ll defer to the words of Mike Shaver and Brendan Eich to explain the reasons as to why, though in a nutshell: The non-technical reasons for choosing Tamarin are over intellectual property and licensing issues and the technical issues are related to co

Tags: firefox, java, mozilla, jvm, mono, tamarin on 2007-08-13 -All Annotations (0) -About

more fromejohn.org

Scott Moody 1Expand

Title Capitalization in JavaScript & Python

Title Capitalization in JavaScript The excellent John Gruber recently released a Perl script which is capable of providing pretty capitalization of titles (generally most useful for posting links or blog posts). The code handles a number of edge cases, as outlined by Gruber: It knows about small words that should not be capitalized. Not all style guides use the same list of words — for example, many lowercase with, but I do not. The list of words is easily modified to suit your own taste/rules: "a an and as at but by en for if in of on or the to v[.]? via vs[.]?" (The only trickery here is that “v” and “vs” include optional dots, expressed in regex syntax.) The script assumes that words with capitalized letters other than the first character are already correctly capitalized. This means it will leave a word like “iTunes” alone, rather than mangling it into “ITunes” or, worse, “Itunes”. It also skips over any words with line dots; “example.com” and “del.icio.us” will remain lowercase. It has hard-coded hacks specifically to deal with odd cases I’ve run into, like “AT&T” and “Q&A”, both of which contain small words (at and a) which normally should be lowercase. The first and last word of the title are always capitalized, so input such as “Nothing to be afraid of” will be turned into “Nothing to Be Afraid Of”. A small word after a colon will be capitalized. He goes on to provide a full list of edge cases that this script handles. My Perl is a little bit rusty but I worked through the code and ported it to JavaScript.

Tags: textFormatting, sourcecode, python, javascript on 2008-06-05 and saved by2 people -All Annotations (0) -About

more fromejohn.org

1 - 20 Next ›
List 20 50 100

Notation: * = Private bookmark and comment| = Clipping [?] | = Public highlight [?]