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
private static void OverrideTransactionScopeTimeout(TimeSpan timeOut) | |
{ | |
var transactionManager = typeof(TransactionManager); | |
var cachedMaxTimeout = transactionManager.GetField("_cachedMaxTimeout", BindingFlags.NonPublic | BindingFlags.Static); | |
var maximumTimeout = transactionManager.GetField("_maximumTimeout", BindingFlags.NonPublic | BindingFlags.Static); | |
var defaultTimeout = transactionManager.GetField("_defaultTimeout", BindingFlags.NonPublic | BindingFlags.Static); | |
var defaultTimeoutValidated = transactionManager.GetField("_defaultTimeoutValidated", BindingFlags.NonPublic | BindingFlags.Static); | |
cachedMaxTimeout.SetValue(null, true); |
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.Collections.ObjectModel; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Hangfire; | |
using Hangfire.Logging; | |
using Hangfire.Redis; | |
using Hangfire.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
[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
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
$(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
/* 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(); |
OlderNewer