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 HangfireJobStatusUpdateAttribute : JobFilterAttribute, IElectStateFilter | |
{ | |
private IScheduledTasksRepository _repo; | |
private IScheduledTaskLogRepository _log; | |
private ITransactionFactory _tranFactory; | |
private ICronService _cronSvc; | |
/// <summary> | |
/// Initializes a new instance of the <see cref="HangfireJobStatusUpdateAttribute"/> class. | |
/// </summary> |
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
# Redirect HTTP without www to HTTP with www | |
RewriteCond %{HTTPS} off | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# Redirect HTTPS without www to HTTPS with www | |
RewriteCond %{HTTPS} on | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
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 TestController : Controller | |
{ | |
public string ViewThis() | |
{ | |
return "Test, Dennis"; | |
} | |
} | |
//using default routes from Empty MVC2 Web Application, http://localhost:xxxxx/Test/ViewThis should return just that text |
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
SELECT UserLogin, FirstName, LastName | |
FROM Users | |
LEFT OUTER JOIN | |
( | |
SELECT UserID | |
FROM UserPropertyValues | |
WHERE PropertyValueID IN (@PropertyIDs) | |
GROUP BY UserID | |
HAVING COUNT(UserID) = | |
( |
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
SET NOCOUNT ON | |
IF OBJECT_ID('tempdb..##INDEXTEMP') IS NOT NULL begin exec sp_executesql N'DROP TABLE ##INDEXTEMP' end | |
EXEC sp_MSforeachtable | |
@command1 = N'INSERT INTO ##INDEXTEMP ([name], [rows], [reserved], [data], [index_size], [unused]) exec sp_spaceused ''?'', ''true'';' | |
, @precommand = N'CREATE TABLE ##INDEXTEMP ([id] int identity(1,1) not null,[name] sysname,[rows] int,[reserved] varchar(20),[data] varchar(20),[index_size] varchar(20),[unused] varchar(20))' | |
, @postcommand = N' | |
SELECT | |
[name], [rows], [reserved], [data], [index_size], [unused] |
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
$server = "localhost"; # The SQL Server instance name | |
$database = "MyDB"; # The database name | |
# Load the SMO assembly | |
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null | |
# Create the SMO objects | |
$srv = New-Object "Microsoft.SqlServer.Management.SMO.Server" $server; | |
$db = New-Object ("Microsoft.SqlServer.Management.SMO.Database"); | |
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
Uri uri = new Uri(url); | |
Console.WriteLine(uri.GetLeftPart(UriPartial.Path)); |
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 Bootstrapper | |
Public Shared Sub BootstrapStructureMap() | |
ObjectFactory.Initialize(AddressOf AutoRegisterStructureMap) | |
End Sub | |
Private Shared Sub AutoRegisterStructureMap(ByVal s As IInitializationExpression) | |
s.Scan(AddressOf ScanAssemblies) | |
End Sub |
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
DECLARE @sql VARCHAR(255) | |
SET @sql = 'SELECT Testing FROM @tbl WHERE CONTAINS(*, ''"' + @p0 + '*"'')' | |
EXEC @sql |
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"> | |
function redirectToHttps() | |
{ | |
var httpURL = window.location.hostname + window.location.pathname + window.location.search; | |
var httpsURL = "https://" + httpURL ; | |
window.location = httpsURL ; | |
} | |
redirectToHttps(); |
OlderNewer