Skip to content

Instantly share code, notes, and snippets.

View AlexZeitler's full-sized avatar
👷‍♂️
Building stuff

Alexander Zeitler AlexZeitler

👷‍♂️
Building stuff
View GitHub Profile
$(document).ready(function () {
var contentsViewModel = function () {
this.contents = handbuch.contents;
};
var menu = $("#menu");
ko.applyBindings(new contentsViewModel, menu);
})
$(document).ready(function () {
var contentsViewModel = function () {
this.contents = handbuch.contents;
};
var menu = document.getElementById("menu");
ko.applyBindings(new contentsViewModel, menu);
})
$("#menu").get(); //get all DOM objects in the jQuery collection
var menu = $("#menu").get(0); //get the DOM object in the jQuery collection at index 0
var menu = $("#menu")[0]; //get the DOM object in the jQuery collection at index 0
[Test]
public void CanHasHash1() {
var hash1 = "123".GetHashCode();
var hash2 = "234".GetHashCode();
var actual = (hash1 - hash2);
Assert.AreEqual(actual, 1566083913);
}
routes.MapRoute(
name: "MVC Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "MVC Default",
url: "{controller}/{action}/{id}",
defaults: new { action = "Index", id = UrlParameter.Optional }
);
[WebGet(UriTemplate = "")]
public List<Customer> Get() {
return new List<Customer>()
{
new Customer() { Id = 1, Name = "ALFKI"},
new Customer() { Id = 2, Name = "WELLI"}
};
}
public class CustomersController : ApiController {
// Get /api/customers
public List<Customer> Get() {
return new List<Customer>()
{
new Customer() {Id = 1, Name = "ALFKI"},
new Customer() {Id = 2, Name = "WELLI"}
};
}
routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);