Skip to content

Instantly share code, notes, and snippets.

@igormoochnick
igormoochnick / gist:3737856
Created September 17, 2012 14:59
Enabling RavenDB web console for the Embedded/hosted configuration
int port = 8080;
NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(port);
var docStore = new EmbeddableDocumentStore {DataDirectory = "Data", UseEmbeddedHttpServer = true};
var ravenConfiguration = _docStore.Configuration;
ravenConfiguration.Port = port;
// OPTIONAL: ravenConfiguration.WebDir = "Web";
// OPTIONAL: ravenConfiguration.DataDirectory = "Data";
// OPTIONAL: ravenConfiguration.DefaultStorageTypeName = "esent";
@igormoochnick
igormoochnick / gist:3411363
Created August 21, 2012 03:50
jinx - using generated data models with the REST service
this.registerOnServer = function () {
$.post("/api/ToDo", getDataModel());
};
this.removeFromServer = function () {
$.ajax({
type: "DELETE",
url: "/api/ToDo/" + self.guid
});
};
@igormoochnick
igormoochnick / gist:3411136
Created August 21, 2012 03:06
jinx - Resulting data model
var ToDoItem = function() {
var self = this;
return {
guid: "",
title: "",
completed: false,
};
};
@igormoochnick
igormoochnick / gist:3411131
Created August 21, 2012 03:06
jinx - Source data model
[JavaScript]
public class ToDoItem
{
public Guid guid { get; set; }
public string title { get; set; }
public bool completed { get; set; }
}
@igormoochnick
igormoochnick / gist:3154224
Created July 21, 2012 01:52
SPA view dependency to a dynamic Asp.Net Mvc content
define(["text!/../home/hello"], function (template) {
// ... Here is your code ...
});
@igormoochnick
igormoochnick / gist:3154215
Created July 21, 2012 01:48
Asp.Net Mvc 4 controller route with a Model injection into a view
//
// GET: /Home/Hello
public ActionResult Hello()
{
var serverInfo = new ServerInfo {Id = "Smart Server "};
return View(serverInfo);
}
@igormoochnick
igormoochnick / gist:3154205
Created July 21, 2012 01:44
Asp.Net Mvc 4 Dynamic View with a Model
<div id="home" style="border: 2px; background: #FF0097;">
<h2>Welcome to "Honey-do-list"<br/>from a "@Model.Id"</h2>
</div>
@igormoochnick
igormoochnick / gist:2944955
Created June 17, 2012 16:04
My test gist
This is a test Gist