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
@Form.For(Model, ExpController.Urls.Update.Post(), @=> builder { | |
<fieldset> | |
@builder.EditorFor(m => m.Name) | |
@builder.FieldsFor(m => m.Person, @=> personfields { | |
@personfields.EditorFor(m => m.Name) | |
@personfields.EditorFor(m => m.Phone) |
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
API 1 | |
<h1>New User</h1> | |
</div> | |
@Form.For(Model, UsersController.Urls.Create.Post(), @=> builder { | |
builder.FormTemplate(@=> template { | |
<div class="clearfix"> | |
@template.Label() |
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 MsMvcHandler : Castle.MonoRail.Hosting.ComposableHandler | |
{ | |
public override bool TryProcessRequest(HttpContextBase request) | |
{ | |
var routeData = RouteTable.Routes.GetRouteData(request); | |
if (routeData != null) | |
{ | |
var routeHandler = routeData.RouteHandler; | |
var requestContext = new RequestContext(request, routeData); | |
IHttpHandler httpHandler = routeHandler.GetHttpHandler(requestContext); |
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 ActionResult Access(Repository repos, AcceptableMedia accepts, bool isLastResourceInPath) | |
{ | |
if (isLastResourceInPath && accepts.Prefers(MimeTypes.Html)) | |
{ | |
return new ContentNegotiatedResult(); | |
} | |
return EmptyResult.Instance; | |
} |
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
var app = require('../app'); | |
var request = require('supertest'); | |
describe('app', function() { | |
before(function(done) { | |
var server = app.listen(1900, done); | |
}); | |
it('404 works', function() { |
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
it("responds to 'new_user' event", function(done) { | |
var user = new Model.User({ | |
'email': 'thisemail@something.com', | |
'name': 'testing' | |
}); | |
_root.child('/users/').once('child_added', function(data) { | |
expect(data.name()).to.be(user._id.toString()); | |
var userData = data.val(); | |
expect(userData.name).to.be(user.name); |
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
data = { | |
orgs: [ | |
{ key: 'orgkey', name: 'orgname', | |
projects: [ | |
{ key: 'projkey', name: 'projname' } | |
] } | |
] | |
}; | |
{{#data.orgs}} |
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
private func validateInputs() -> Bool { | |
let nonEmpty = { | |
(data:String!) -> Bool in | |
return count(data) != 0 | |
} | |
func inRange (min: Int!, max:Int!) -> (String!) -> Bool { | |
return { (data:String!) -> Bool in | |
let dataAsInt = data.toInt() | |
return (dataAsInt! >= min && dataAsInt! <= max) |
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
%% The contents of this file are subject to the Mozilla Public License | |
%% Version 1.1 (the "License"); you may not use this file except in | |
%% compliance with the License. You may obtain a copy of the License | |
%% at http://www.mozilla.org/MPL/ | |
%% | |
%% Software distributed under the License is distributed on an "AS IS" | |
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See | |
%% the License for the specific language governing rights and | |
%% limitations under the License. | |
%% |
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
internal class RingBufferStream : Stream | |
{ | |
private const int BufferSize = 1024; | |
private volatile int _totalLen = 0; | |
private volatile int _readPosition = -1; | |
private volatile int _writePosition = -1; | |
private readonly ManualResetEventSlim _locker = new ManualResetEventSlim(false); | |
private readonly byte[] _buffer; |
OlderNewer