Profile
Achievement
 
    
                jasonseney's Recent Snippets
- All /
 « Prev 1 Next »
Will find all __TIF__ files and create new __JPG__ files of the same file name.
-  97% quality
- Resize _down only_ to `1024x1280`
        
        
        
            0 
        
        
            1017 
        
                    posted 13 years ago by jasonseney
            Safely loads a javascript file asynchronously
Example:
	(function() {
		__safeLoadScript("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js", function() {
			alert(jQuery);
		});
	})();
        
        
        
            0 
        
        
            1008 
        
                    posted 14 years ago by jasonseney
            Will return the host name that the site is running on. Example:
`http://mysite.com` or `http://myspecialsite.com:102`
        
        
        
            0 
        
        
            1674 
        
                    posted 14 years ago by jasonseney
            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.
        
        
        
            0 
        
        
            1272 
        
                    posted 15 years ago by jasonseney
            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.
        
        
        
            0 
        
        
            1512 
        
                    posted 15 years ago by jasonseney
            [Credit - Sam Allen, Dot Net Perls](http://dotnetperls.com/remove-html-tags)
        
        
        
            2 
        
        
            1928 
        
                    posted 16 years ago by jasonseney
            Basic example of calling a web service from code using GET. You can pass parameters in as query vars.
Assumes return type of service is "String". Example return xml:
    <?xml>
    <string>US</string>
@SNIPPLR TEAM: Please let me put xml at...
        
        
        
            3 
        
        
            1975 
        
                    posted 16 years ago by jasonseney
            ## Markup ##
_Using square [ ] brackets for compatibility with Snipplr comment form_
	[asp:PlaceHolder ID="StuffHolder" runat="server" ]
		<p>Some stuff in here</p>
	[/asp:PlaceHolder]                
## Code Behind ##
	HtmlAttr[] attribu...
        
        
        
            1 
        
        
            1927 
        
                    posted 16 years ago by jasonseney
            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")
        
        
        
            3 
        
        
            1587 
        
                    posted 16 years ago by jasonseney
            Will return a string that has any matched URLs wrapped in `<a>` tags.
Example: `"This is a link to http://foobar.com . Please visit !"`
Becomes: `"This is a link to <a href='http://foobar.com'>http://foobar.com</a> . Please visit!"`
Note: Op...
        
        
        
            2 
        
        
            5739 
        
                    posted 16 years ago by jasonseney
            Example uses an object from 3rd party API. Needed to turn it into xml for returning from a webservice.
        
        
        
            0 
        
        
            1089 
        
                    posted 16 years ago by jasonseney
            View version with full names here:
[Dropdown-states](http://snipplr.com/view/4042/dropdown-states/ "View full names version")
        
        
        
            3 
        
        
            2063 
        
                    posted 16 years ago by jasonseney
            Example:
`var result = "Hello {0}! This is {1}.".format("world","foo bar");`
Returns: 
`"Hello World! This is foo bar."`
        
        
        
            2 
        
        
            1831 
        
                    posted 17 years ago by jasonseney