search
Carter Cole LinkedInCarters Twitter PageCarter Cole on Facebook Carter Coles RSS

Thursday, October 29, 2009

Awesome code syntax highlighting made easy

So ive finally come across an awesome syntax highlighter that i think will work well for most any application and it works well on Blogger Hosting which is even better. It uses a flash swf to do a click to copy button and has support for a variety of languages as well as a bunch of themes

here is the code you need to drop right before your <head> tag in the HTML of your blogger template (or wherever you may find yourself in a need of a syntax highlighter). just remove any lines for languages you don't use...
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shCore.css' rel='stylesheet' type='text/css'/> 
<link href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'></script> 
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'></script> 
<script language='javascript'> 
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>
and a little about how to use it...
you can use a special <script> tag with CDATA around it
<script type="syntaxhighlighter" class="brush: html"><![CDATA[
<html>
<head>
<title>Carter Tomorrow Fund Donations</title>
<meta name="title" content="Help Give to the Carter Tomorrow Fund" /> 
<meta name="description" content="Show your support and help out with a small gift" 
]]></script>

- or -

you can use a <Pre> tag with html escaped characters
heres a quick way to escape your html

Theme Preview Widget

and this is my way cool theme switcher... just click the css theme below to see how it looks (you will need to change the second line that imports the style sheet to use the filename you want to use from below) check below the switcher to see theme with white background...so thats about it. if you found the post helpful please consider linking to this post...
and you can see your linkback at the bottom :) thanks

Another note for blogger users...

you will see the following message if you you the
<script class="brush: html" type="syntaxhighlighter"> method
Your HTML cannot be accepted: Tag is broken: ![CDATA[
Stop showing HTML errors for the body of this post
just disregard it... im sending a message to blogger about it but it doesn't understand CDATA tag
it will also keep you from saving a draft of the post. its uncool but you can fix it by putting a space before the <![CDATA[ like this < ![CDATA[ (dont forget to add a space at end and change ]]> to ]] >) then it wont count it as a broken tag and you can save just remember to switch it back before you publish

Thursday, October 22, 2009

Google to join the Twitter bandwagon and Yahoo, Bing

edit: ok so bing already kinda has a twitter search that it plans to improve on but like Google tweets still aren't on main results page but Yahoo (who props to them i like their new stuff) plans to change that announcing that they will be showing tweets in results soon this will hopefully help yahoo gain some ground back as they are struggling keeping their part of the search pie. Google social search experiment is the closest thing google has for social media search so far



the title says it all i was reading my daily rss and this clicked across...
Official Google Blog: RT @google: Tweets and updates and search, oh my!

so Google is going to be joining the twitter bandwagon. but wheres the link? Bing looks like they are ahead of the game already with their Bing Twitter Search it has a small tag cloud but little more im sure google will do it better with longer history but i wonder if we will see ReTweet tools built into searches with the ability to pass oAuth to Twitter and tweet from inside our searches. if it was an unobtrusive menue id think it was great. what are your thoughts?

Tuesday, October 13, 2009

fetch as googlebot and other webmaster tools

I subscribe to the Google Webmaster Blog and i saw this click by in my reader this morning and i wanted to do a quick blurb about these new features in google webmaster tools as well as the other webmaster tools that are out there and what they can be used for so lets get into it...

Google Webmaster Tools

ok so google has some really great stuff in their tools but lets real quick talk about the features they added today. First they added the ability to Fetch as GoogleBot so you can see how your page looks to the crawler.

heres how it pulled blog.cartercole.com
This is how Googlebot fetched the page.
URL: http://blog.cartercole.com/
Date: Tue Oct 13 07:46:33 PDT 2009
HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Expires: Tue, 13 Oct 2009 09:14:43 GMT
Date: Tue, 13 Oct 2009 09:14:43 GMT
Cache-Control: public, max-age=0, must-revalidate, proxy-revalidate
Last-Modified: Tue, 13 Oct 2009 09:08:25 GMT
ETag: "02afcfab-2808-4275-8274-6da1b3584a07"
Content-Encoding: gzip
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Content-Length: 17486
Server: GFE/2.0

-cut for length -

you will also now be notified when your page has been infected which basically looks up your pages automatically with Googles safe browsing API
manual lookup: http://www.google.com/safebrowsing/diagnostic?site=http://blog.cartercole.com

here are some other options / tools you get...
  • changing GoogleBot crawl speed
  • the major keywords google found for your site
  • manage sitelinks for your site (if you get them)
  • a list of links to your site (not complete)
  • much more id defiantly check it out
and the API docs for google webmaster tools


Yahoo Site Explorer

ok generally yahoo site explorer will give you the best link list of any other free tool i know and you can get this cool badge



to display the links to your pages and thats about all it does right now
also yahoo site explorer API docs

Bing Webmaster Center

ok bings back up so ill finsih my post about them asap

oops looks like the Bing Webmaster Center is having some trouble...
They are back up now but if you care this is what they were showing for a couple days...
We are experiencing an issue processing your request at this time.
The Webmaster Center Team has been notified of the error and will work to resolve it. Try again in a few minutes.
yall should get on that this guy has already mentioned it

please leave comments with questions / comments / concerns id love to hear from you

Saturday, October 3, 2009

my very own #list of twitter tools and sites

theres been tons of twitter lists like this one or here but heres my list

TweetMeMe
Twitter news aggregator

TwerBose
when you want to be able to post longer tweets

TwitterFeed
Post your RSS to twitter

TweetStats
Stats about your twitter account

TwitterCounter
Tracks your followers

TwitterGrader
Grades your twitter account

TwitPic
Tweet your pics on twitter and track views

CurseBird
Real time tracking of twitter cursing

FutureTweets
Tweet into the future and reoccurring

Tweleted
Find tweets people delete

TwitterKarma
Get your carma on twitter see who you follow and who follows you

TwitterAnalyzer
Looks at your tweets by time and other stats

ReTweetRadar
Trend tracking

Twitscoop
Another twitter client [uses oAuth]

TwitSpy
Spys on public timeline of twitter

TweetingTooHard
A place ot vote on peoples craziest tweets

PorTwiture
Makes a collage of your status out of images

Mozaic of tweets
title says it all

TimeTweets
The time in tweets...

TwitterFountain
A flowing fountain of twitter tweets

TweetTree
This expands and builds your twitter feed into all its parts loading my hulu feed as well as images and other stuff

TwitterHolic
its what all the junkies do

TweetCloud
view your tweets as a tag cloud

TweetBroadCast
Allows you to broadcast your tweets across your friends