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
GRANT CREATE PROCEDURE TO [SqlUser]; | |
GRANT CREATE SERVICE TO [SqlUser]; | |
GRANT CREATE QUEUE TO [SqlUser]; | |
GRANT REFERENCES ON CONTRACT::[http://schemas.microsoft.com/SQL/Notifications/PostQueryNotification] TO [SqlUser]; | |
GRANT SUBSCRIBE QUERY NOTIFICATIONS TO [SqlUser]; | |
GRANT CONTROL ON SCHEMA::[dbo] TO [SqlUser]; | |
GRANT IMPERSONATE ON USER::DBO TO [SqlUser]; | |
-- This acually works | |
-- https://social.msdn.microsoft.com/Forums/sqlserver/en-US/bd195da8-93b2-43c6-8f59-674f5fb9d618/cannot-find-the-queue-sqlquerynotificationserviceguid?forum=sqlservicebroker&prof=required |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\narrator.exe] | |
"Debugger"="%1" | |
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
# | |
# Powershell script that deploys the dacpac to (localdb)\MSSQLLocalDB that the integration tests can run against. | |
# | |
$dbname = "xxx" | |
$dacpacname = "xxx.dacpac" | |
# Locate dacpac | |
$dacpac = gci -Recurse -Filter "$dacpacname" -ErrorAction SilentlyContinue | Select -First 1 |
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
[AttributeUsage(AttributeTargets.Method)] | |
public class ValidationActionFilterAttribute : ActionFilterAttribute | |
{ | |
public override void OnActionExecuting(HttpActionContext actionContext) | |
{ | |
InnerOnActionExecuting(actionContext); | |
var modelState = actionContext.ModelState; | |
if (modelState.IsValid) |
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
// JS array equivalents to C# LINQ methods - by Dan B. | |
// Here's a simple array of "person" objects | |
var people = [ | |
{ name: "John", age: 20 }, | |
{ name: "Mary", age: 35 }, | |
{ name: "Arthur", age: 78 }, | |
{ name: "Mike", age: 27 }, | |
{ name: "Judy", age: 42 }, | |
{ name: "Tim", age: 8 } |
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
fix by adding following line | |
------------- | |
options.exclude = options.exclude.split ',' | |
in cli.coffee | |
(Windows path: C:\Users\xxx\AppData\Roaming\npm\node_modules\jscpd\src\cli\) | |
jscpd -g csharp -o report.txt --exclude **/*.Designer.cs,**/XsdGeneratedClasses.cs |
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
/// <summary> | |
/// Fix of JsonMediaTypeFormatter that does not convert JSON to object when Request is in Chunked Transfer Encoding. | |
/// </summary> | |
public class XJsonMediaTypeFormatter : JsonMediaTypeFormatter | |
{ | |
/// <summary> | |
/// Replaces web api default JsonMediaTypeFormatter with this instance. | |
/// Usage: | |
/// protected void Application_Start() | |
/// { |
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
mongodump --host mongodb1.example.net \ | |
--db db_name \ | |
--collection collection_name \ | |
--query '{ _id: { $gte: ObjectId("537c3ca7cfefc541c4a41a8e") } }' \ | |
--out /tmp/mongodump | |
bsondump tmp/mongodump/Historic.bson/db_name/mongodump.bson |
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
/// Ruthlessly inspired by from http://kozmic.net/2014/03/22/strongly-typed-app-settings-with-castle-dictionaryadapter/ | |
public class AppSettingRequiredAttribute : Attribute | |
{ | |
} | |
public class AppSettingWrapperAttribute : DictionaryBehaviorAttribute, IDictionaryPropertyGetter, IPropertyDescriptorInitializer | |
{ | |
object IDictionaryPropertyGetter.GetPropertyValue(IDictionaryAdapter dictionaryAdapter, string key, object storedValue, PropertyDescriptor property, bool ifExists) | |
{ |
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
/// <summary> | |
/// "Fast"-implementation of building HashCode | |
/// </summary> | |
public static class HashCodeBuilder | |
{ | |
internal const int Seedingprime = 42; | |
internal const int Hashingprime = 37; | |
public static int BuildHashCode(params object[] args) | |
{ |