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 static class Extensions{ | |
/** | |
* Rounds the supplied number to the nearest multiple of the parameter | |
* @param this int The number to round | |
* @param int The multiple to use | |
* @return int | |
* @static | |
* @extension | |
*/ |
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.Text; | |
namespace Validation | |
{ | |
public class AddressComponent { | |
public string long_name { get; set; } | |
public string short_name { get; set; } | |
public List<string> types { 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
Name: restrictInput | |
Signature: restrictInput(string type, event keypress); | |
Description: Restricts input to fields to specified values | |
Usage: $("#myfieldID").keydown(function(e)){ | |
restrictInput("alpha",e); | |
}; | |
Types: | |
alphanumeric - All letters and numbers |
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
var previousHeight, currentHeight=0; | |
while(previousHeight !== currentHeight) { | |
previousHeight = currentHeight; | |
var currentHeight = yield nightmare.evaluate(function() { | |
return document.body.scrollHeight; | |
}); | |
yield nightmare.scrollTo(currentHeight, 0) | |
.wait(3000); | |
} |
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
create function dbo.getFullyQualifiedName( | |
@objectid int | |
) returns sysname | |
begin | |
declare @fqn sysname | |
select | |
@fqn = CONCAT( | |
QUOTENAME(@@SERVERNAME), '.', | |
QUOTENAME(DB_NAME()), '.', |
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 blocked_query.session_id AS blocked_session_id, | |
blocking_query.session_id AS blocking_session_id, | |
sql_text.text AS blocked_text, | |
sql_btext.text AS blocking_text, | |
waits.wait_type AS blocking_resource |
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 c.name AS 'ColumnName' | |
,t.name AS 'TableName' | |
FROM sys.columns c | |
JOIN sys.tables t ON c.object_id = t.object_id | |
WHERE c.name LIKE '%COLUMN NAME%' | |
ORDER BY TableName | |
,ColumnName; |
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 | |
GO | |
DECLARE @table TABLE( | |
RowId INT PRIMARY KEY IDENTITY(1, 1), | |
ForeignKeyConstraintName NVARCHAR(200), | |
ForeignKeyConstraintTableSchema NVARCHAR(200), | |
ForeignKeyConstraintTableName NVARCHAR(200), | |
ForeignKeyConstraintColumnName NVARCHAR(200), | |
PrimaryKeyConstraintName NVARCHAR(200), |
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.Web.Http; | |
using Owin; | |
namespace SelfHosted{ | |
public class Startup{ | |
public void Configuration(IAppBuilder app){ | |
// Configure Web API for self-host. | |
var config = new HttpConfiguration(); | |
config.Routes.MapHttpRoute( | |
name: "DefaultApi", |
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.Collections.Generic; | |
using System.Web.Http; | |
namespace SelfHosted{ | |
public class HelloController : ApiController{ | |
// GET api/hello | |
public IEnumerable Get(){ | |
return new string[] { "Hello", "World" }; | |
} |