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 log4net; | |
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using System.Net.Configuration; | |
using System.Net.Mail; | |
using System.Net.Mime; | |
using System.Threading.Tasks; | |
using System.Web; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using System.Web; | |
namespace MyApp.Helpers | |
{ | |
public static class HtmlHelper |
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 Microsoft.Owin.Security; | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.ComponentModel.DataAnnotations; | |
using System.Globalization; | |
using System.IO; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Net; |
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
--Database Analysis Report for SQL Server | |
--Author: M.Ali | |
--Source: http://stackoverflow.com/questions/19433902/how-to-analyze-tables-for-size-in-a-single-db-using-sql-server | |
SET NOCOUNT ON | |
DBCC UPDATEUSAGE(0) | |
-- DB size. |
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
/******************************************************/ | |
/** Description:Deletes all Stored Procedures in the **/ | |
/** given Database. **/ | |
/** **/ | |
/** WARNING: This can be very Dangerous. Verify **/ | |
/** your current Database connection **/ | |
/** before use. It is recommended to **/ | |
/** enter the Target Database in the **/ | |
/** USE clause. **/ | |
/** **/ |
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
-- Search all SQL Modules (Procedures, etc) for given Search Term | |
DECLARE @Search varchar(255) | |
SET @Search='what I am looking for' | |
SELECT DISTINCT | |
o.name AS Object_Name,o.type_desc | |
FROM sys.sql_modules m | |
INNER JOIN sys.objects o ON m.object_id=o.object_id | |
WHERE m.definition Like '%'+@Search+'%' | |
ORDER BY 2,1 |
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
/***************************************************************************/ | |
/* Use the following Stored Procedure call to re-sync or resolve a user */ | |
/* from an imported database to an existing SQL Server User Login Account. */ | |
/***************************************************************************/ | |
EXEC sp_change_users_login 'Auto_Fix', 'UserName' |
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
// Simple Example of using LINQ 2 XML to Parse XML Data Entries into C# Objects | |
// Author: Sergey Berezovskiy | |
// Source: http://stackoverflow.com/questions/14226473/c-sharp-parsing-xml-file | |
// NOTE: Your XML file should have a single root node | |
var xdoc = XDocument.Load(path_to_xml); | |
var entries = from e in xdoc.Descendants("entry") | |
select new { | |
Id = (int)e.Attribute("id"), | |
Type = (string)e.Attribute("type"), |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
--Constants in SQL Server | |
--Since SQL Server and T-SQL doesn't support the concept of | |
--Constants, this is one example of how to mimic the functionality. | |
--Source: http://stackoverflow.com/questions/26652/is-there-a-way-to-make-a-tsql-variable-constant | |
CREATE FUNCTION fnConstant() | |
RETURNS INT | |
AS | |
BEGIN | |
RETURN 2 |
OlderNewer