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> | |
/// A cache wrapper that invalidates multiple objects based on string dependency keys. | |
/// </summary> | |
public class DefaultCacheHelper : ICacheHelper | |
{ | |
private readonly IMemoryCache _cache; | |
private readonly ILogger<DefaultCacheHelper> _logger; | |
private readonly CacheSettingsConfig _cacheSettingsConfig; | |
// a place to hold cancellation tokens to invalidate the cache | |
private static readonly ConcurrentDictionary<string, CancellationTokenSource> _cancellationTokens = new ConcurrentDictionary<string, CancellationTokenSource>(); |
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
Test-NetConnection <address> -p <port_number> |
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 | |
t.NAME AS TableName, | |
i.name as indexName, | |
sum(p.rows) as RowCounts, | |
sum(a.total_pages) as TotalPages, | |
sum(a.used_pages) as UsedPages, | |
sum(a.data_pages) as DataPages, | |
(sum(a.total_pages) * 8) / 1024 as TotalSpaceMB, | |
(sum(a.used_pages) * 8) / 1024 as UsedSpaceMB, | |
(sum(a.data_pages) * 8) / 1024 as DataSpaceMB |
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 S.name as 'Schema', | |
T.name as 'Table', | |
I.name as 'Index', | |
DDIPS.avg_fragmentation_in_percent, | |
DDIPS.page_count | |
FROM sys.dm_db_index_physical_stats (DB_ID(), NULL, NULL, NULL, NULL) AS DDIPS | |
INNER JOIN sys.tables T on T.object_id = DDIPS.object_id | |
INNER JOIN sys.schemas S on T.schema_id = S.schema_id | |
INNER JOIN sys.indexes I ON I.object_id = DDIPS.object_id | |
AND DDIPS.index_id = I.index_id |
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
/* Transformation Examples */ | |
// Ternary example | |
<%# !string.IsNullOrEmpty((string)Eval("ItemToTest")) ? "True" : "False" %> | |
<%# !String.IsNullOrEmpty(Eval("ItemToTest").ToString()) ? "True" : "False" %> | |
<%# !string.IsNullOrEmpty((string)Eval("CatalogLink")) ? "<p>For detailed curriculum and more, please visit the <a href=\"" + Eval("CatalogLink") + "\" target=\"_blank\">Course Catalog entry</a> for this program.</p>" : Eval("CatalogDescription") + "<br /><br /><strong>For detailed curriculum and more please visit the <a onclick=\"_gaq.push(['_trackEvent', 'Link', 'Click' 'Course Catalog Adult Education'])\" target=\"_blank\" href=\"" + Eval("CatalogLink") + "\">Course Catalog entry</a> for this program.</strong><br />" %> | |
<%# !String.IsNullOrEmpty(Eval("ScheduleOfBenefitsDownload").ToString()) || !String.IsNullOrEmpty(Eval("ProviderNetwork").ToString()) ? "<strong>Resources</strong><br>" : "" %> | |
/* ********** */ |
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 ISystemService | |
{ | |
bool IsRunningInDebugMode(); | |
} | |
public class SystemService : ISystemService | |
{ | |
private bool _debugging; | |
public bool IsRunningInDebugMode() |
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 DataTableExtensions | |
{ | |
public static List<T> ToList<T>(this DataTable table) where T : new() | |
{ | |
IList<PropertyInfo> properties = typeof(T).GetProperties().ToList(); | |
List<T> result = new List<T>(); | |
foreach (var row in table.Rows) | |
{ | |
var item = CreateItemFromRow<T>((DataRow)row, properties); |
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
// https://github.com/PButcher/flipdown | |
import { FlipDown } from 'flipdown'; |
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
# https://youtube.com/c/cognitivesurge | |
export ZSH="/Users/karl/.oh-my-zsh" | |
ZSH_THEME="robbyrussell" | |
plugins=( | |
git | |
bundler | |
dotenv | |
osx |
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
# setup font settings | |
font_family FuraCode Nerd Font | |
font_size 18.0 | |
# no bells. Ever. | |
enable_audio_bell no | |
bell_on_tab no | |
# default layout is vertical splits only | |
enabled_layouts splits |