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
dotnet new nunit | |
dotnet add package FluentAssertions | |
dotnet test |
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 | |
( | |
dp.state_desc + ' ' + | |
dp.permission_name collate latin1_general_cs_as + | |
' ON ' + '[' + s.name + ']' + '.' + '[' + o.name + ']' + | |
' TO ' + '[' + dpr.name + ']' | |
) AS GRANT_STMT | |
FROM sys.database_permissions AS dp | |
INNER JOIN sys.objects AS o ON dp.major_id=o.object_id | |
INNER JOIN sys.schemas AS s ON o.schema_id = s.schema_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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
XDocument xDocument; | |
using (XmlReader xr = XmlReader.Create(@"c:\Users\akramarev\Downloads\TestResultSet.xml")) | |
{ | |
xDocument = XDocument.Load(xr); | |
} |
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 session_id as SPID, command, a.text AS Query, start_time, percent_complete, dateadd(second,estimated_completion_time/1000, getdate()) as estimated_completion_time | |
FROM sys.dm_exec_requests r CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a | |
WHERE r.command in ('BACKUP DATABASE','BACKUP LOG','RESTORE DATABASE') |
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
{ | |
"editor_path": "/usr/local/bin/code", | |
"editor_argument_format": "--goto ${file}:${line}:${col}" | |
} |
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 | |
relname as table_name, | |
pg_size_pretty(pg_total_relation_size(relid)) As "Total Size", | |
pg_size_pretty(pg_indexes_size(relid)) as "Index Size", | |
pg_size_pretty(pg_relation_size(relid)) as "Actual Size" | |
FROM pg_catalog.pg_statio_user_tables | |
ORDER BY pg_total_relation_size(relid) DESC; |
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 | |
pg_terminate_backend(pid) | |
FROM | |
pg_stat_activity | |
WHERE | |
-- don't kill my own connection! | |
pid <> pg_backend_pid() | |
-- don't kill the connections to other databases | |
AND datname = 'database_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
stty rows 50 cols 132 |
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
apk add --no-cache \ | |
python3 \ | |
py3-pip \ | |
&& pip3 install --upgrade pip \ | |
&& pip3 install --no-cache-dir \ | |
awscli \ | |
&& rm -rf /var/cache/apk/* |
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
import DataLoader from 'dataloader'; | |
import logger from '../../../logger'; | |
export const REDIS_KEY_DELIMITER = '\x1F'; // ASCII unit separator (31 in hex) | |
export const REDIS_NULL_VALUE = '\x00'; // ASCII NULL (0 in hex), value is set but it's null | |
export type RedisNullValueType = '\x00'; | |
export type DistributedDataLoaderOptions<K, V> = DataLoader.Options< | |
K, |