This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Retrieve the name of the the optimizely test with DFP in it and then parse out the number after AB-###. | |
This is for the ad-ops team to use as a way to know what tests are running on the pages that they are serving up ads | |
Test names should follow this pattern: AB-123 description dfp | |
*/ | |
function getDFP() { | |
if ('undefined' != typeof optimizely && 'undefined' != typeof optimizely.allExperiments && 'undefined' != typeof optimizely.variationMap) { | |
var allTests = optimizely.allExperiments; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stops=[]; | |
$.ajax({ | |
url:"http://webservices.nextbus.com/service/publicXMLFeed?command=predictionsForMultiStops&a=sf-muni&stops=37|4169&stops=37|3255&stops=48|3476&stops=48|4924", | |
success:function(xml) { | |
$("predictions", xml).each(function(idx, predictions) { | |
var stop = {times:[]}; | |
$.each(predictions.attributes, function(idx, attribute) { stop[attribute.name] = attribute.value }); | |
$("prediction", predictions).each(function(idx, prediction) { | |
var time = {}; | |
$.each(prediction.attributes, function(idx, attribute) { time[attribute.name] = parseInt(attribute.value) ? parseInt(attribute.value) : attribute.value }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".deferParsing").each(function(idx, elem) { | |
var $elem = $(elem), | |
comments = $elem | |
.contents() | |
.filter(function(){return this.nodeType === 8;}) | |
.get(0) | |
; | |
$elem.replaceWith(comments.nodeValue); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $hoveredSwatch = $("#hoveredSwatch"); | |
var $selectedSwatch = $("#selectedSwatch"); | |
$("area").hover( | |
function() { | |
var altText = $(this).attr("alt"); | |
$hoveredSwatch.html(altText); | |
}, | |
function() { | |
$hoveredSwatch.html(""); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div>Hover over swatch</div> | |
<img src="http://markistaylor.files.wordpress.com/2012/05/swatches.jpg" | |
alt="Swatches" usemap="#swatchmap" /> | |
<map name="swatchmap"> | |
<area shape="rect" coords="0,0,20,20" alt="Graphite" /> | |
<area shape="rect" coords="24,0,44,20" alt="Snow" /> | |
<area shape="rect" coords="50,0,70,20" alt="Poppy" /> | |
<area shape="rect" coords="77,0,97,20" alt="Caynene" /> | |
<area shape="rect" coords="103,0,123,20" alt="Tan" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JavascriptHandler : IHttpHandler | |
{ | |
private readonly static bool enabledAutoMinified = ConfigurationManager.AppSettings["enableAutoMinified"] == "true"; | |
private readonly static Minifier minifier = new Minifier(); | |
private readonly static CodeSettings minifierSettings = new CodeSettings() | |
{ | |
/* Minifier code settings here */ | |
}; | |
bool IHttpHandler.IsReusable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var endpoint = new System.ServiceModel.EndpointAddress("http://www.ecubicle.net/gsearch_rss.asmx"); | |
var binding = new System.ServiceModel.BasicHttpBinding(); | |
var oProxy = System.ServiceModel.ChannelFactory.CreateChannel(binding, endpoint); | |
/* Code specific to service */ | |
var request = new GetSearchResultsRequest() { Body = new GetSearchResultsRequestBody() }; | |
request.Body.searchPage = ""; | |
request.Body.gQuery = "Test"; | |
request.Body.numOfResults = "50"; | |
bool successfulCall = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ExtensionMethods | |
{ | |
/// <summary> | |
/// Creates paginated links | |
/// </summary> | |
/// <param name="helper">HtmlHelper class that can provide access to helpful functionality</param> | |
/// <param name="startPage">Starting page (most likely 1)</param> | |
/// <param name="currentPage">Number of the current page</param> | |
/// <param name="totalPages">Number of total pages</param> | |
/// <param name="pagesToShow">Number of pages to show forward and backward</param> |
NewerOlder