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
[HttpGet] | |
[AvailableFor(UserRole.Administrator, UserRole.RegionalRepresentative)] | |
public ActionResult UnapprovedUser(string id) | |
{ | |
var user = ModelContext.GetService<User>().Get(id); | |
return View(new UnapprovedUserViewModel { Operand = user }); | |
} | |
[HttpPost, AutoTransaction] | |
[AvailableFor(UserRole.Administrator, UserRole.RegionalRepresentative)] |
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 DeliveryService(ModelContext context) | |
{ | |
_modelContext = context; | |
_itemSender = context.Get<EmailDeliverItemSender>(); | |
if (TestMode) | |
{ | |
_itemSender = context.Get<FileDeliveryItemSender>(); | |
} | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Data.SqlClient; | |
using System.Linq; | |
using ChessOk.ModelFramework; | |
using ChessOk.ModelFramework.Web.ClientEvents; | |
namespace ChessOk.ChessSchool.Web.ClientEvents.Storage |
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
CreditCard = | |
cleanNumber: (number) -> number.replace /[- ]/g, "" | |
validNumber: (number) -> | |
total = 0 | |
number = @cleanNumber(number) | |
for i in [(number.length-1)..0] | |
n = +number[i] | |
if (i+number.length) % 2 == 0 | |
n = if n*2 > 9 then n*2 - 9 else n*2 |
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
$(function () { | |
$("#e6").select2({ | |
placeholder: "Search for a movie", | |
minimumInputLength: 1, | |
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper | |
url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", | |
dataType: 'jsonp', | |
data: function (term, page) { | |
return { | |
q: term, // search term |
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
jQuery -> | |
$("#e6").select2 | |
placeholder: "Search for a movie" | |
minimumInputLength: 1 | |
ajax: # instead of writing the function to execute the request we use Select2's convenient helper | |
url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json" | |
dataType: 'jsonp' | |
data: (term, page) -> | |
return { |
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
/* Original code */ | |
var s = 'foo.bar', im = new Image | |
im.src = s; s = im.src | |
console.log(s) | |
/* TypeScript output */ | |
var s = 'foo.bar'; | |
var im = new Image(); |
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
/* Original code */ | |
var s = 'foo.bar', im = new Image | |
im.src = s; s = im.src | |
console.log(s) | |
/* TypeScript output */ | |
var s = 'foo.bar'; | |
var im = new Image(); |
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 FuncJobActivator : JobActivator | |
{ | |
private readonly Container _container; | |
public FuncJobActivator(Container container) | |
{ | |
if (container == null) throw new ArgumentNullException("container"); | |
_container = container; | |
} |
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
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice) | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any purpose | |
// with or without fee is hereby granted. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | |
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | |
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
OlderNewer