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
EXEC sp_who2 | |
-- then | |
KILL <PID No.> | |
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 T GetFromDictionary<T>(string key, IDictionary items, Func<T> whenKeyNotFound) | |
{ | |
if (items[key] != null) | |
{ | |
// return from dictionary | |
return (T)items[key]; | |
} | |
// return new item from caller and add to dictionary |
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 hexToRgb = function(hex) { | |
var parse = function(start, end){ | |
return parseInt(hex.substring(start, end), 16); | |
} | |
hex = hex.replace("#", ""); | |
return { | |
r: parse(0, 2), | |
g: parse(2, 4), |
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
for /r "C:\sourceDir" %%f in (*.fileExt) do @xcopy "%%f" "C:\targetDir" /D /Y |
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 string ParseMultiColumnFields(KeyValuePair<int, List<string>> row, int fromColumn, int toColumn) | |
{ | |
var fields = new StringBuilder(); | |
int lineCount = 0; | |
for (int i = fromColumn; i <= toColumn; i++) | |
{ | |
if (string.IsNullOrEmpty(row.Value[i])) | |
{ | |
break; | |
} |
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 T ParseRequiredValue<T>(string value, Expression<Func<T>> property) where T : IConvertible | |
{ | |
var propertyInfo = ((MemberExpression)property.Body).Member as PropertyInfo; | |
if (typeof(T) == typeof(DateTime)) | |
{ | |
DateTime dt; | |
bool canConvert = DateTime.TryParse(value, CultureInfo.CurrentCulture, DateTimeStyles.None, out dt); | |
if (!canConvert) |
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
<!-- Must include this proj file when creating isapi svc's --> | |
<TokenReplacementFileExtensions>svc</TokenReplacementFileExtensions> |
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 interface IFactory | |
{ | |
IAbbreviationsAndAcronymsService AbbreviationsAndAcronymsService {get; set;} | |
IBusinessActivityService BusinessActivityService {get; set;} | |
Factory Make(ConcreteTypes type); | |
} | |
public class Factory | |
{ | |
public IAbbreviationsAndAcronymsService AbbreviationsAndAcronymsService; |
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> | |
/// Handles Sending of Email notifications | |
/// SP Central Admin From address will be used when From() not provided | |
/// Example Usage: | |
/// MailNotification mailNotification = new MailNotification(SPContext.Current.Web) | |
/// mailNotification.To("someone@somewhere.com.au") | |
/// .From("admin@somewhere.com.au") | |
/// .Subject("You Have Mail") | |
/// .Body("Hello <strong>world</strong>") | |
/// .Send(); |