This file contains hidden or 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 AjaxController : Controller | |
{ | |
readonly IDatabase _db; | |
public AjaxController(IDatabase db) | |
{ | |
_db = db; | |
} | |
// ... snip ... |
This file contains hidden or 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
using System.Data; | |
using System.Linq; | |
using Dapper; | |
using Ledger.Models.Entities; | |
namespace Ledger.Models.CommandQuery.Ledgers | |
{ | |
public class GetLedgerByIdQuery : IQuery<LedgerEntity> | |
{ | |
long id; |
This file contains hidden or 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
using System.Data; | |
using Dapper; | |
using Ledger.Models.Entities; | |
namespace Ledger.Models.CommandQuery.Ledgers | |
{ | |
public class CreateLedgerCommand : ICommand | |
{ | |
readonly LedgerEntity ledger; |
This file contains hidden or 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
using System.Data; | |
namespace Ledger.Models | |
{ | |
public class Database : IDatabase | |
{ | |
readonly IDbConnection _db; | |
public Database(IDbConnection db) | |
{ |
This file contains hidden or 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
with Text_IO; | |
procedure Hello_World is | |
begin | |
Text_IO.Put_line("Hello World!"); | |
end Hello_World; |
This file contains hidden or 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
<% | |
dim myXml 'assume that this is populate with an XML string | |
dim oXml | |
Set oXml = Server.CreateObject("MSXML2.DOMDocument.6.0") 'don't forget to use Set | |
oXml.LoadXML(myXml) | |
dim node | |
Set node = oXml.selectSingleNode("//@ShoeSize") 'don't forget to use Set | |
response.write "Shoe Size: " & node.text & "<br />" 'outputs: "Shoe Size: 13<br />" |
This file contains hidden or 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
<USER_INFO ShoeSize="13" FirstName="Matthew" LastName="Groves" City="Funkytown, USA" /> |
This file contains hidden or 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
<% | |
'assume there's an HTTP header "someid: value" | |
dim someId | |
someId = Request.ServerVariables ("HTTP_someid") | |
response.write "someId: " & someId 'this outputs "someId: value" | |
response.end | |
%> |
This file contains hidden or 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
<% | |
'assume there's an HTTP header "some_id: value" | |
dim someId | |
someId = Request.ServerVariables ("HTTP_some_id") | |
response.write "someId: " & someId 'this outputs "someId:" NOT "someId: value" | |
response.end | |
%> |
This file contains hidden or 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 src="~/Scripts/jquery.js" type="text/javascript"></script> | |
<script src="~/Scripts/doT.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var template = $("#my-dot-template"); | |
var dotted = doT.template(template.html()); | |
// I'm building up an object here with literals | |
// but typically this data would be returned by an ajax request | |
var data = {}; |