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 UserSession:IUserSession{ | |
private readonly IAuthenticationService _authenticationService; | |
private readonly ICryptographer _crypto; | |
private readonly IUserRepository _repository; | |
public UserSession(IUserRepository repository,IAuthenticationService authenticationService,ICryptographer crypto){ | |
Guard.AgainstNull(repository); | |
Guard.AgainstNull(authenticationService); | |
Guard.AgainstNull(crypto); | |
_repository=repository; | |
_crypto=crypto; |
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
My service defintion held inside my services layer - no access to web app | |
public interface IUserSession | |
{ | |
void LogOut(); | |
string GetUsername(); | |
LoggedonuserDTO GetCurrentUser(); | |
} | |
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
import os, shlex, subprocess, re, datetime | |
class MsBuilder: | |
def __init__(self, msbuild=None, mstest=None, nuget=None, trx2html=None): | |
# The following dictionary holds the location of the various | |
# msbuild.exe paths for the .net framework versions | |
if msbuild==None: | |
self.msbuild = r'C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe' | |
else: | |
self.msbuild = msbuild |
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.IO; | |
using FluentNHibernate; | |
using FluentNHibernate.AutoMap; | |
using FluentNHibernate.Cfg.Db; | |
using NHibernate; | |
using NHibernate.Cfg; | |
using NHibernate.Context; | |
using NHibernate.Event; |
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
/** | |
* Text Color Plugin | |
*/ | |
GENTICS.Aloha.TextColor = new GENTICS.Aloha.Plugin('TextColor'); | |
/** | |
* Configure the available languages | |
*/ | |
GENTICS.Aloha.TextColor.languages = ['en', 'ru']; |
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 decimal GetTaxes(decimal salary) | |
{ | |
decimal tax = 0; | |
var progressiveTaxation = new[] { 0.1m, 0.14m, 0.23m, 0.3m, 0.33m, 0.45m }; | |
var progressionSlices = new[] { 5070 - 0, 8660 - 5070, 14070 - 8660, 21240 - 14070, 40230 - 21240, decimal.MaxValue }; | |
var progression = 0; | |
while (salary > 0) |
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
// custom css expression for a case-insensitive contains() | |
$.expr[':'].Contains = function(a, i, m) { | |
return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase()) >= 0; | |
}; | |
$(".search-box").keyup(function(e) { | |
//get current value | |
var that = $(this).val(); | |
if (that.length > 0) { //something exists |
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
[Test] | |
public void IsApplesOrBannans() | |
{ | |
bool IsApple = true; | |
bool IsBannana = false; | |
if (!IsApple && !IsBannana) | |
Assert.Fail(); | |
Assert.Pass(); |
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.Linq; | |
using System.Text; | |
namespace dictionary | |
{ | |
public class CustomerModel | |
{ | |
public string Model { get; set; } |
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
<script type="text/javascript"> | |
/** | |
* Author: Rob Audenaerde | |
*/ | |
function resetTableSizes (table, change, columnIndex) | |
{ | |
//calculate new width; | |
var tableId = table.attr('id'); | |
var myWidth = $('#'+tableId+' TR TH').get(columnIndex).offsetWidth; |
OlderNewer