<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 10 Jun 2026 09:52:27 +0000</lastBuildDate>
    <item>
      <title>(Bash) Convert Image Format and Preserve Names - jasonseney</title>
      <link>https://snipplr.com/view/63555/convert-image-format-and-preserve-names</link>
      <description>&lt;p&gt;Will find all __TIF__ files and create new __JPG__ files of the same file name.&#13;
&#13;
-  97% quality&#13;
- Resize _down only_ to `1024x1280`&lt;/p&gt;</description>
      <pubDate>Fri, 24 Feb 2012 07:25:50 UTC</pubDate>
      <guid>https://snipplr.com/view/63555/convert-image-format-and-preserve-names</guid>
    </item>
    <item>
      <title>(Other) Vim - Escape % in a Batch script on current line - jasonseney</title>
      <link>https://snipplr.com/view/55603/vim--escape--in-a-batch-script-on-current-line</link>
      <description>&lt;p&gt;Does a search and replace to make all % on the line %% (ignores any %'s already escaped)&lt;/p&gt;</description>
      <pubDate>Thu, 23 Jun 2011 01:47:07 UTC</pubDate>
      <guid>https://snipplr.com/view/55603/vim--escape--in-a-batch-script-on-current-line</guid>
    </item>
    <item>
      <title>(JavaScript) Safe Script Load - jasonseney</title>
      <link>https://snipplr.com/view/51965/safe-script-load</link>
      <description>&lt;p&gt;Safely loads a javascript file asynchronously&#13;
&#13;
Example:&#13;
&#13;
	(function() {&#13;
		__safeLoadScript("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", function() {&#13;
			alert(jQuery);&#13;
		});&#13;
	})();&lt;/p&gt;</description>
      <pubDate>Tue, 12 Apr 2011 14:16:31 UTC</pubDate>
      <guid>https://snipplr.com/view/51965/safe-script-load</guid>
    </item>
    <item>
      <title>(C#) Get the Host Name in ASP.NET C# - jasonseney</title>
      <link>https://snipplr.com/view/50795/get-the-host-name-in-aspnet-c</link>
      <description>&lt;p&gt;Will return the host name that the site is running on. Example:&#13;
&#13;
`http://mysite.com` or `http://myspecialsite.com:102`&lt;/p&gt;</description>
      <pubDate>Fri, 18 Mar 2011 07:33:58 UTC</pubDate>
      <guid>https://snipplr.com/view/50795/get-the-host-name-in-aspnet-c</guid>
    </item>
    <item>
      <title>(JavaScript) Javascript DOM - getElementsByClassName - jasonseney</title>
      <link>https://snipplr.com/view/32961/javascript-dom--getelementsbyclassname</link>
      <description>&lt;p&gt;Similar to [Get Elements by Class Name]( http://snipplr.com/view/1696/get-elements-by-class-name/), but with optional "tag" parameter. Performance is increased by first retrieving the desired tag if available.&lt;/p&gt;</description>
      <pubDate>Fri, 23 Apr 2010 09:29:36 UTC</pubDate>
      <guid>https://snipplr.com/view/32961/javascript-dom--getelementsbyclassname</guid>
    </item>
    <item>
      <title>(JavaScript) Javascript DOM - Create Element - jasonseney</title>
      <link>https://snipplr.com/view/30037/javascript-dom--create-element</link>
      <description>&lt;p&gt;Basic create element and append it too another element.&lt;/p&gt;</description>
      <pubDate>Fri, 19 Mar 2010 15:38:59 UTC</pubDate>
      <guid>https://snipplr.com/view/30037/javascript-dom--create-element</guid>
    </item>
    <item>
      <title>(JavaScript) Loop on jQuery object and return value - jasonseney</title>
      <link>https://snipplr.com/view/22417/loop-on-jquery-object-and-return-value</link>
      <description>&lt;p&gt;Returning a boolean inside of jQuery's $.each() function will only break the loop. To get a return value, you can convert the jQuery object to array and use a regular for loop in javascript.&lt;/p&gt;</description>
      <pubDate>Tue, 03 Nov 2009 13:13:44 UTC</pubDate>
      <guid>https://snipplr.com/view/22417/loop-on-jquery-object-and-return-value</guid>
    </item>
    <item>
      <title>(Java) Enum serializaition and deserialization - jasonseney</title>
      <link>https://snipplr.com/view/21108/enum-serializaition-and-deserialization</link>
      <description>&lt;p&gt;//Sample use&#13;
    String dbVal = getSerializedForm(Suit.SPADE);&#13;
&#13;
    // save dbVal to db in larger insert/update ...&#13;
    Suit suit = deserialize(Suit.class, dbVal);&#13;
&#13;
*Credit: Dov Wasserman*&lt;/p&gt;</description>
      <pubDate>Tue, 13 Oct 2009 14:35:58 UTC</pubDate>
      <guid>https://snipplr.com/view/21108/enum-serializaition-and-deserialization</guid>
    </item>
    <item>
      <title>(JavaScript) Technorati Ping - JScript WSH (javascript with XMLHTTP) - jasonseney</title>
      <link>https://snipplr.com/view/20914/technorati-ping--jscript-wsh-javascript-with-xmlhttp</link>
      <description>&lt;p&gt;Run in cmd with:&#13;
&#13;
    &gt; CScript pingTechnorati.js BLOG_NAME BLOG_URL&lt;/p&gt;</description>
      <pubDate>Fri, 09 Oct 2009 19:19:14 UTC</pubDate>
      <guid>https://snipplr.com/view/20914/technorati-ping--jscript-wsh-javascript-with-xmlhttp</guid>
    </item>
    <item>
      <title>(C#) C# Strip XML/HTML from string - jasonseney</title>
      <link>https://snipplr.com/view/20590/c-strip-xmlhtml-from-string</link>
      <description>&lt;p&gt;[Credit - Sam Allen, Dot Net Perls](http://dotnetperls.com/remove-html-tags)&lt;/p&gt;</description>
      <pubDate>Fri, 02 Oct 2009 12:31:52 UTC</pubDate>
      <guid>https://snipplr.com/view/20590/c-strip-xmlhtml-from-string</guid>
    </item>
    <item>
      <title>(C#) C# Truncate String Text - jasonseney</title>
      <link>https://snipplr.com/view/20589/c-truncate-string-text</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 02 Oct 2009 12:23:31 UTC</pubDate>
      <guid>https://snipplr.com/view/20589/c-truncate-string-text</guid>
    </item>
    <item>
      <title>(DOS Batch) Batch resize in DOS batch file with imagemagick - jasonseney</title>
      <link>https://snipplr.com/view/20515/batch-resize-in-dos-batch-file-with-imagemagick</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 01 Oct 2009 02:23:32 UTC</pubDate>
      <guid>https://snipplr.com/view/20515/batch-resize-in-dos-batch-file-with-imagemagick</guid>
    </item>
    <item>
      <title>(C#) C# Call Web Service and Get String Result - jasonseney</title>
      <link>https://snipplr.com/view/15436/c-call-web-service-and-get-string-result</link>
      <description>&lt;p&gt;Basic example of calling a web service from code using GET. You can pass parameters in as query vars.&#13;
&#13;
Assumes return type of service is "String". Example return xml:&#13;
&#13;
    &lt;?xml&gt;&#13;
    &lt;string&gt;US&lt;/string&gt;&#13;
&#13;
@SNIPPLR TEAM: Please let me put xml attributes in code sections in comments!&lt;/p&gt;</description>
      <pubDate>Mon, 01 Jun 2009 16:49:16 UTC</pubDate>
      <guid>https://snipplr.com/view/15436/c-call-web-service-and-get-string-result</guid>
    </item>
    <item>
      <title>(C#) Convert ASP.NET PlaceHolder to HTML tag with attributes - jasonseney</title>
      <link>https://snipplr.com/view/15032/convert-aspnet-placeholder-to-html-tag-with-attributes</link>
      <description>&lt;p&gt;## Markup ##&#13;
_Using square [ ] brackets for compatibility with Snipplr comment form_&#13;
&#13;
	[asp:PlaceHolder ID="StuffHolder" runat="server" ]&#13;
		&lt;p&gt;Some stuff in here&lt;/p&gt;&#13;
	[/asp:PlaceHolder]                &#13;
&#13;
## Code Behind ##&#13;
&#13;
	HtmlAttr[] attributes = {&#13;
		new HtmlAttr("id","stuff"),&#13;
		new HtmlAttr("class","container")&#13;
	};&#13;
	PlaceHolderToTag(StuffHolder, "div", attributes);&#13;
&#13;
## Result ##&#13;
&#13;
	[div id="stuff" class="container"]&#13;
		&lt;p&gt;Some stuff in here&lt;/p&gt;&#13;
	[/div]&#13;
	&#13;
### Notes:&#13;
&#13;
Useful with the "Visible" property on the placeholder, and facilites &#13;
programmically setting IDs on DIVs (can set id based on some item name)&lt;/p&gt;</description>
      <pubDate>Thu, 14 May 2009 15:08:05 UTC</pubDate>
      <guid>https://snipplr.com/view/15032/convert-aspnet-placeholder-to-html-tag-with-attributes</guid>
    </item>
    <item>
      <title>(JavaScript) Javascript check for undefined or null object/variable - jasonseney</title>
      <link>https://snipplr.com/view/14618/javascript-check-for-undefined-or-null-objectvariable</link>
      <description>&lt;p&gt;Based on some comments in [StackOverflow Question](http://stackoverflow.com/questions/95875/javascript-check-to-see-if-a-variable-is-an-object "How to check if a variable is an object")&lt;/p&gt;</description>
      <pubDate>Thu, 30 Apr 2009 16:44:02 UTC</pubDate>
      <guid>https://snipplr.com/view/14618/javascript-check-for-undefined-or-null-objectvariable</guid>
    </item>
    <item>
      <title>(JavaScript) Check For Console object in web browser with JavaScript - jasonseney</title>
      <link>https://snipplr.com/view/13489/check-for-console-object-in-web-browser-with-javascript</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 26 Mar 2009 16:03:46 UTC</pubDate>
      <guid>https://snipplr.com/view/13489/check-for-console-object-in-web-browser-with-javascript</guid>
    </item>
    <item>
      <title>(C#) Format URLs in string to HTML Links in C# - jasonseney</title>
      <link>https://snipplr.com/view/13286/format-urls-in-string-to-html-links-in-c</link>
      <description>&lt;p&gt;Will return a string that has any matched URLs wrapped in `&lt;a&gt;` tags.&#13;
&#13;
Example: `"This is a link to http://foobar.com . Please visit !"`&#13;
&#13;
Becomes: `"This is a link to &lt;a href='http://foobar.com'&gt;http://foobar.com&lt;/a&gt; . Please visit!"`&#13;
&#13;
Note: Opens links in new window.&#13;
&#13;
Credit for regex:&#13;
[Faraz Shah Khan](http://weblogs.asp.net/farazshahkhan/archive/2008/08/09/regex-to-find-url-within-text-and-make-them-as-link.aspx "Credit")&lt;/p&gt;</description>
      <pubDate>Thu, 19 Mar 2009 17:22:27 UTC</pubDate>
      <guid>https://snipplr.com/view/13286/format-urls-in-string-to-html-links-in-c</guid>
    </item>
    <item>
      <title>(C#) Create basic XmlDocument from Scratch - jasonseney</title>
      <link>https://snipplr.com/view/12932/create-basic-xmldocument-from-scratch</link>
      <description>&lt;p&gt;Example uses an object from 3rd party API. Needed to turn it into xml for returning from a webservice.&lt;/p&gt;</description>
      <pubDate>Mon, 09 Mar 2009 11:22:39 UTC</pubDate>
      <guid>https://snipplr.com/view/12932/create-basic-xmldocument-from-scratch</guid>
    </item>
    <item>
      <title>(ASP) ASP:DropDownList US States (Abbreviated) - jasonseney</title>
      <link>https://snipplr.com/view/9904/aspdropdownlist-us-states-abbreviated</link>
      <description>&lt;p&gt;View version with full names here:&#13;
[Dropdown-states](http://snipplr.com/view/4042/dropdown-states/ "View full names version")&lt;/p&gt;</description>
      <pubDate>Tue, 18 Nov 2008 19:39:20 UTC</pubDate>
      <guid>https://snipplr.com/view/9904/aspdropdownlist-us-states-abbreviated</guid>
    </item>
    <item>
      <title>(JavaScript) Add Preceding Zeros to Score - jasonseney</title>
      <link>https://snipplr.com/view/9037/add-preceding-zeros-to-score</link>
      <description>&lt;p&gt;Example:&#13;
&#13;
`addZeros((549).toString(),7);`&#13;
&#13;
Returns:&#13;
&#13;
`"0000549"`&lt;/p&gt;</description>
      <pubDate>Wed, 15 Oct 2008 14:48:46 UTC</pubDate>
      <guid>https://snipplr.com/view/9037/add-preceding-zeros-to-score</guid>
    </item>
    <item>
      <title>(JavaScript) Sprintf in Javascript (string format) - jasonseney</title>
      <link>https://snipplr.com/view/8984/sprintf-in-javascript-string-format</link>
      <description>&lt;p&gt;Example:&#13;
&#13;
`var result = "Hello {0}! This is {1}.".format("world","foo bar");`&#13;
&#13;
Returns: &#13;
&#13;
`"Hello World! This is foo bar."`&lt;/p&gt;</description>
      <pubDate>Mon, 13 Oct 2008 18:42:30 UTC</pubDate>
      <guid>https://snipplr.com/view/8984/sprintf-in-javascript-string-format</guid>
    </item>
  </channel>
</rss>
