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 StepOne | |
{ | |
[Remote("Tenant", "Validation", "Api", "host", ErrorMessage = "The provided host already exists.")] | |
public string Host | |
{ | |
get; | |
set; | |
} | |
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 Heirarchy<T> where T : class | |
{ | |
public Heirarchy() | |
{ | |
Children = new List<T>(); | |
} | |
public virtual T Parent | |
{ | |
get; |
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
protected void Button_Click(object sender, EventArgs e) | |
{ | |
// give the message a unique identifier (guid?) | |
var message = new SomeActionMessage(); | |
// ---------------------------------------------------- | |
// I'm adding my messages to a queue with 2 properties | |
// The current time, and the ID of the message | |
// ---------------------------------------------------- |
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
// to cache a query do something like: | |
var query = Session.CreateCriteria<T>() | |
.Add(Expression.Eq("Id", id)) | |
.SetCacheable(true); |
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
<section class="grid_8"> | |
@using (Html.BeginForm("create", "promotion", FormMethod.Post, new { @class = "form" })) | |
{ | |
<fieldset> | |
<p> | |
@Html.LabelFor(x => x.Title) | |
@Html.TextBoxFor(x => x.Title, new { @class = "liquid" }) | |
@Html.ValidationMessageFor(x => x.Title) | |
</p> | |
<p> |
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 IList<Location> NearbyLocations(decimal latitude, decimal longitude, int distance, int excludeLocationId) | |
{ | |
var criteria = Session.CreateSQLQuery("exec NearbyLocations @Latitude=:latitude, @Longitude=:longitude, @Distance=:distance, @ExcludeId=:excludeid"); | |
criteria.SetDecimal("latitude", latitude); | |
criteria.SetDecimal("longitude", longitude); | |
criteria.SetInt32("distance", distance); | |
criteria.SetInt32("excludeid", excludeLocationId); | |
criteria.AddEntity(typeof (Location)); |
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
#pageContainerSelector ul, | |
#pageContainerSelector li | |
{ | |
list-style: inherit; | |
} | |
#pageContainerSelector small | |
{ | |
font-weight: inherit; | |
} |
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
# HTML | |
# <iframe id="website-container" src="http://example.com"></iframe> | |
// ... | |
// set iframe src on click event | |
// ... | |
// does this get a value? | |
var height = $('#website-container > html > body').height(); |
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
// say this is the "button" click that makes the iframe fullscreen | |
$('button.fullscreen').click(function() { | |
// fetch existing iframe | |
var $iframe = $('#iframeId'); | |
// clone iframe to push it into a new content area | |
var $iframeInstance = $iframe.clone(); | |
// add clone to body |
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
<script type="text/javascript"> | |
// protect against multiple google analytics instances | |
var _gaq = _gaq || []; | |
// inform google whose account is being used | |
_gaq.push(['_setAccount', 'UA-27464642-1']); | |
// inform google to track a pageview on this page | |
_gaq.push(['_trackPageview']); |
OlderNewer