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> | |
/// AES (Advanced Encryption Standard) encryptor and dencryptor. | |
/// </summary> | |
public interface IAesEncryptor | |
{ | |
/// <summary> | |
/// Pass in a UTF8 encoded string and get back a base64 encoded string of the encrypted data. | |
/// </summary> | |
/// <param name="utf8String">The UTF8 encoded string to encode.</param> | |
/// <param name="password">The password.</param> |
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
-- FIELD is the unique field to find duplicates on | |
delete TABLENAME | |
from TABLENAME | |
left outer join ( | |
select min([Key]) as [Key], FIELD | |
from TABLENAME | |
group by FIELD | |
) as temp on | |
TABLENAME.[Key] = temp.[Key] | |
where temp.[Key] is null |
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 CacheExtensions | |
{ | |
private static readonly object ThisLock = new object(); | |
public static T Get<T>(this Cache cache, string key, Func<T> builder, DateTime expiration) | |
{ | |
var data = cache.Get(key); | |
if (data == null) | |
{ | |
lock (ThisLock) |
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
function namespace(path) { | |
var root = window; | |
var names = path.split('.'); | |
for (i = 0; i < names.length; i++) { | |
root[names[i]] = root[names[i]] || {}; | |
root = root[names[i]]; | |
} | |
}; |