Monday, December 15, 2008

Google hosted jQuery

Link to jQuery library hosted on Google's CDN:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
http://encosia.com/2008/12/10/3-reasons-why-you-should-let-google-host-jquery-for-you/

Wednesday, December 10, 2008

string.Empty and string.Format code snippets

Just put them in files "string.Empty.snippet" and "string.Format.snippet" in folder "My Documents\Visual Studio 2008\Code Snippets\Visual C#\My Code Snippets". More on creating code snippets: http://msdn.microsoft.com/en-us/library/ms165393(VS.80).aspx. string.Empty:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
   <Header>
       <Title>se</Title>
       <Shortcut>se</Shortcut>
       <Description>Code snippet for "string.Empty"</Description>
       <SnippetTypes>
           <SnippetType>Expansion</SnippetType>
       </SnippetTypes>
   </Header>
   <Snippet>
       <Code Language="csharp">
           <![CDATA[string.Empty$end$]]>
       </Code>
   </Snippet>
</CodeSnippet>
</CodeSnippets>
string.Format():
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
   <Header>
       <Title>sf</Title>
       <Shortcut>sf</Shortcut>
       <Description>Code snippet for "string.Format()"</Description>
       <SnippetTypes>
           <SnippetType>Expansion</SnippetType>
           <SnippetType>SurroundsWith</SnippetType>
       </SnippetTypes>
   </Header>
   <Snippet>
       <Code Language="csharp">
           <![CDATA[string.Format($selected$$end$)]]>
       </Code>
   </Snippet>
</CodeSnippet>
</CodeSnippets>