Skip to content

Instantly share code, notes, and snippets.

View cceremuga's full-sized avatar

Craig Ceremuga cceremuga

  • Vistar Media
  • Albany, NY
  • 21:23 (UTC -04:00)
View GitHub Profile
@cceremuga
cceremuga / gist:9001819
Created February 14, 2014 14:24
Easy Native HTML5 Geolocation (no external library needed)
function successCallback(position) {
//set latitude / longitude
var nearLat = position.coords.latitude;
var nearLong = position.coords.longitude;
//do whatever you need with the lat / long here
console.log('Latitude: ' + nearLat + ' Longitude: ' + nearLong);
}
function errorCallback(error) {
@cceremuga
cceremuga / gist:5858390
Created June 25, 2013 13:23
Perform a taxonomy path based search with the Ektron 8.7 SearchManager class. In this example, I have 3 dropdown lists with optional category filters on a search. The value of the dropdown list item is a taxonomy path. When multiple dropdowns are selected, it is searching with AND based logic.
//create advanced search
AdvancedSearchCriteria criteria = new AdvancedSearchCriteria();
criteria.OrderBy = new List<OrderData>()
{
new OrderData(SearchContentProperty.DateCreated, OrderDirection.Descending)
};
criteria.PagingInfo = new PagingInfo(500);
criteria.PagingInfo.CurrentPage = 1;
criteria.ReturnProperties = new HashSet<PropertyExpression>()
{
@cceremuga
cceremuga / gist:5204350
Created March 20, 2013 12:42
ASP:DataPager control settings to work perfectly w/ the Bootstrap single button group
<asp:DataPager ID="DataPagerProducts" runat="server" PagedControlID="LvCategoryItems" PageSize="10" OnPreRender="PagerCategoryItems_PreRender" class="btn-group pager-buttons">
<Fields>
<asp:NextPreviousPagerField ShowLastPageButton="False" ShowNextPageButton="False" ButtonType="Button" ButtonCssClass="btn" RenderNonBreakingSpacesBetweenControls="false" />
<asp:NumericPagerField ButtonType="Button" RenderNonBreakingSpacesBetweenControls="false" NumericButtonCssClass="btn" CurrentPageLabelCssClass="btn disabled" NextPreviousButtonCssClass="btn" />
<asp:NextPreviousPagerField ShowFirstPageButton="False" ShowPreviousPageButton="False" ButtonType="Button" ButtonCssClass="btn" RenderNonBreakingSpacesBetweenControls="false" />
</Fields>
</asp:DataPager>