Issue #34 (lastIndexOf(), Text Editors, Testing, Content)
(Skip to the tools section below)
There's also a method called lastIndexOf(), which you don't see as often. This method returns the position of the last instance of the substring, also returning -1 if nothing is found. And just like indexOf(), lastIndexOf() lets you pass in an optional second argument that defines where in the string to start the search.
var stringOne = "How much wood could " +
"a wood chuck chuck if " +
"a wood chuck could chuck wood?",
findCandy = stringOne.lastIndexOf('wood'),
findCandy2 = stringOne.lastIndexOf('wood chuck'),
op = document.getElementById('op');
console.log(findCandy + ', ' + findCandy2); // "67 & 44"
The difference, however, with lastIndexOf() when using the optional parameter is the fact that the position is counted from the start, but the search goes in reverse from the defined position: So with the same string from the previous example, the following would return 22:
findCandy3 = stringOne.lastIndexOf('wood chuck', 32); // 22
This is because everything after character 32 is disregarded, because the search starts at character 32 and works backwards, looking for the substring "wood chuck". Here's the code.
As a side point, keep in mind that both these methods are case sensitive, so changing the substring to "Wood chuck" would return -1 in all cases.
Super easy stuff this week, huh? :)
Now on to this week's tools!
Text Editors, IDEs, etc.
"I'd like to share with you a number of themes for some popular text editors that will hopefully be pleasing to your eyes and allow you to enjoy the time you spend in front of the screen."
This looks really nice... "A color scheme editor for SublimeText, Textmate and bunch of other text editors."
"A plugin for Sublime Text 3 that provides a framework for linting code. Whatever language you code in, SublimeLinter can help you write cleaner, better, more bug-free code."
"A live HTML/CSS editor for rapid style protyping." This one actually has a CSS-y feel to its design. I don't know why.
"A set of custom UI themes for Sublime Text 2/3. It's all about hype and minimal. Comes in different flavors with accompanying Base16 color schemes." The "Spacegray Eighties" theme looks real nice.
"A Sublime Text 2 plugin for creating and editing Gists."
Check out one of this week's sponsors:
Testing and Debugging Tools
What's My Browser?
Grabs a snapshot of your browser details so you can send a link with the info to a support team.
Not an official Google app, but a simple website that lets you enter a URL and it will assess the page based on Google Webmaster Guidelines.
"Uses a Blackhole server ... to simulate what will happen if a third-party provider goes down."
"Run web accessibility audits on urls or files, from the command line or within Ruby."
A highly configurable website monitoring service with the ability to do tests on API health and uptime.
A Chrome extension that's "great for switching in development scripts for live scripts or switching between minified and development versions of frameworks such as jQuery, mootools etc."
This is really interesting: It's a "Website Improvement Platform" that will adjust your website's layout according to user interaction, to improve ad revenue.
A Chrome Extension to let you identify any font on a web page with a single click. I like this because I often find dev tools are annoying for this.
Documents, Files, Content, etc.
"Use your mobile as a trackpad/keyboard for your media server or laptop during a presentation."
"SFTP download and file organization tool for headless servers. Runs on Mac OS X and Linux."
HTML2PDF Web Service
"Design your invoices or reports in HTML, style them with CSS and convert the resulting page into a PDF document."
"A client-side browser based application that allows the user to read and write encrypted text files to a cloud service."
A Tweet for Thought
Jared Spool quoting Luke Wroblewski on PayPal's mind-blowing mobile revenue increase over the past 5 years.
Suggestions / Corrections
Made something? Send links via Twitter @WebToolsWeekly (details here). No tutorials or articles, please. If you have any suggestions, corrections, or improvements, feel free to reply to this email.
Before I Go...
If you produce HTML email, you might want to start keeping tabs on the W3C's HTML for email Community Group.
Thanks to all for subscribing and reading!