Skip to content

Instantly share code, notes, and snippets.

@mikeedwards83
mikeedwards83 / Speed.cs
Last active December 3, 2015 22:04
Speed Test Code
service = new SitecoreContext();
var results = new Results();
Stopwatch watch3 = new Stopwatch();
watch3.Start();
for (int i = 0; i < 10000; i++)
@mikeedwards83
mikeedwards83 / Simple.cs
Created July 29, 2015 15:06
Xamarin Countdown Problem
public class Simple : CountDownTimer
{
event TickHandler _onTick;
event TickHandler _onFinished;
public event TickHandler OnTicked
{
add { _onTick += value; }
remove { _onTick -= value; }
}
@mikeedwards83
mikeedwards83 / Gallery Languages.xml
Created July 9, 2015 12:46
Example of how to customise the language dropdown in Sitecore
@mikeedwards83
mikeedwards83 / Textbox.js
Last active August 29, 2015 14:23
Append textbox values to html so that they can be copied and pasted.
var textBoxes = $$('input[type="text"]');
for(var i = textBoxes.length-1; i > -1 ; i--){
var txt = textBoxes[i];
var val = txt.value;
txt.parentElement.appendChild(document.createTextNode(val));
}
@mikeedwards83
mikeedwards83 / ProductController.cs
Created April 30, 2015 15:11
ProductController.cs for Glass.Mapper.Sc Workbook
public class ProductController : GlassController
{
public List<Product> Basket
{
get
{
if (HttpContext.Session["ProductBasket"] == null)
{
HttpContext.Session["ProductBasket"] = new List<Product>();
}
@mikeedwards83
mikeedwards83 / Navigation.ascx
Created April 30, 2015 15:08
Navigation.ascx for Glass.Mapper.Sc Workbook
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">
<!-- insert code here -->
</a>
</div>
<div id="navbar">
<ul class="nav navbar-nav">
<!-- insert code here -->
@mikeedwards83
mikeedwards83 / HomeJumbo.ascx
Created April 30, 2015 15:06
HomeJumbo.ascx for Glass.Mapper.Sc Workbook
<div class="jumbotron">
<div class="container">
<h1>
<!-- insert code here -->
</h1>
<!-- insert code here -->
<p>
<a class="btn btn-primary btn-lg" role="button" href="insert code here" >Learn More</a>
@mikeedwards83
mikeedwards83 / List.cshtml
Created April 30, 2015 13:40
List.cshtml for Glass.Mapper.Sc Workbook
<div class="row">
<div class="col-md-12">
<h3>Comments</h3>
@if (Model.Comments == null || !Model.Comments.Any())
{
<p>
Be the first to make a comment.
</p>
}
else
@mikeedwards83
mikeedwards83 / LeftMenu.ascx
Created April 30, 2015 08:10
LeftMenu.ascx for Glass.Mapper.Sc Workbook
<h4>
<i class="glyphicon glyphicon-arrow-up"></i>
<!-- insert code here -->
</h4>
<% if (Model.Children.Any())
{ %>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Pages:</h3>
@mikeedwards83
mikeedwards83 / HomeFeatured.ascx
Created April 30, 2015 08:08
HomeFeatured.ascx for Glass.Mapper.Sc Workbook
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<!-- insert code here -->
</div>
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>